Monthly Archives: February 2012

PHP stdin – Reading user input from command line in PHP

In C++ it is called cin, and in perl it is $variable = <STDIN> however what is the equivalent of cin and STDIN for PHP? Well in PHP is is similar to perl in that we use php://stdin to read a user’s input from the command line. It is pretty straight forward and hopefully the [...]

Increase PHP Memory Limit in htaccess, apache or in a php script

Most of us have come across this error: “Fatal error: Allowed memory size of xxxxxx bytes exhausted (tried to allocate yyy bytes) in ….” in the php error logs. In php, running out of memory in usually a sign that your php script is not too well written or has a bug or two in [...]

PHP Pear – Installing Pear and Pear Packages

What is PEAR? PEAR is an acronym for PHP Extension and Application Repository. PEAR is a massive repository for PHP code. It provide easy access to hundreds of classes that can be implemented into your existing PHP project. It saves you time since you won’t have to write anything from scratch and you can simply reuse [...]