Optimized code for reverse phone php app (reviewed by Udit).