use php intelligently