Optimal Algorithms for Php Code