Tuesday, November 17, 2009

Monday, November 16, 2009

Debug console

The debugConsole is a tool for debugging and tracing PHP5 applications on productive servers without compromising the live-traffic. For more details refer at

Find all anchor tags in a page with PHP and the Simple HTML DOM Parser

Refer at

Really Useful Classes And Libraries For PHP Developers

Refer at

Wednesday, November 11, 2009

Thursday, July 23, 2009

Firefox plugin To view and modify the HTTP/HTTPS headers and post parameters

Use tamperdata to view and modify HTTP/HTTPS headers and post parameters. The add ons available at

Flip-A jquery plugin!

For details head over at this link

Friday, July 3, 2009

Using PHP's glob() function to find files in a directory

Here is the details to get a list of all the files in a given directory.

Wednesday, June 10, 2009

Setting cookies with jQuery

For setting a cookie in the client side we usually go for normal javascript. Here i found one article where we can use jquery plugin to do the cookie manipulation. The code is very use and easy to manipulate. For more details check it here

Monday, June 1, 2009

Fastest way to build an HTML string

There are different ways we can build an HTML string . I was going through one article which clearly gives the different ways including benchmark results. For more information head over at this link

Tuesday, May 12, 2009

MySQL: Find records in one table that are not in another

Using NOT EXISTS is much faster than using LEFT JOIN to find records in one table that are not in another. Head over at for more details on the same

Tuesday, March 10, 2009

PHP micro-optimization tips

  • calling an object method is faster then traping it with with "__call"
  • calling a "static" method is faster then an object method
  • calling a function is faster then calling a static method
  • accessing a local variable is faster then then a global variable
  • accessing a global variable is faster then an object property
  • accessing an object property is faster then trapping it with "__get" and "__set"
  • accessing an initialized variable is faster then accessing an uninitialized variable
  • absolute paths in "include" and "require" are faster then relative
  • merging several scripts in one file and then including it is faster then several includes
  • "switch" is faster then "if ... else if ..." in some cases
  • do not use regexs for simple string processing tasks
  • avoid @ (error control operator)
  • avoid notices and warnings in your scripts
  • avoid unused variables and unused method parameters
  • adding method parameter increases calling time
  • adding method parameter type hint increases calling time
  • unset variables that contain large amount of data or circular references
  • $_SERVER['REQUEST_TIME'] contains script startup time
  • cache page output or result of resource-consuming functions
  • "echo" is faster than "print"
  • "echo" accepts several arguments, you can use it instead of string concatenation
  • "ob_start()" and "ob_end_clean()" is may be better then several string concatenations
  • strings in single quotes ('...') are processed faster then strings in double quotes ("...")
  • pre-increment (++$i) is faster then post-increment ($i++)
  • "isset" is a faster alternative to "array_key_exists"
  • an array is a faster alternative to a class with several fields
  • "foreach" is better then "for" in many cases
  • open resources (files, database connections, sockets) right before using them, free resources as soon as you do not need them
  • do not fetch database fields which you do not use in your script
  • use prepared database statements
  • combine several queries in one when database supports it