Thursday, March 31, 2011

Best introduction for PEAR

 PEAR - PHP Extension and Application Repository
 PEAR is a framework and distribution system for reusable PHP components.

Install all PEAR packages

In this case, you are in full control of the entire PEAR packages installation, including PEAR Base System and any additional packages you need.
  • Step #1: Install PEAR Base System
  • Step #2: Create PEAR include path.
  • Step #3: Test if PEAR has been installed correctly.
Read all at

Monday, March 14, 2011

func_num_args and func_get_args - php

func_num_args — Returns the number of arguments passed to the function
func_get_args -- Returns an array comprising a function's argument list.

 function countAll() {
       $numargs = func_num_args();
       echo "Number of arguments: $numargs\n";
     countAll(ab, bc, cd, df);  // Prints 'Number of arguments: 3'
   function getName() {
        echo func_get_arg(0);      
        echo "nothing";
     getName(ab, bc, cd, df);  // Prints 'ab'