Optimize PHP Codes Tricks

Use echo, not print, Unset your variable when your job is over that variable, especially for large arrays, Don’t use require_once, Use full paths for includes, str_replace is faster than ereg_replace but strtr is fastest.. If you can, use strtr, Close your database connections when you are finish your process, Using $table[‘id’] is faster than …

Continue reading