PHP

Useful functions

extract(array)

Walks through an assosiative array and initializes variable with names of the keys and values of the values.

get_defined_vars()

returns all variables valid in the current scope

Strings

Explode = Split

array explode (string separator, string string [, int limit])

Implode = Join

string implode (string glue, array pieces)

Useful functions

string strtolower (string str)
string strtoupper (string string)

Special Variables

$_POST - an associative array of the arguments sent via a post request $_GET - an associative array of the arguments sent via a get request

$argv[0] - the get string

Files

PHP on the Command line

Reading input and writing output:

  $input = fgets(STDIN);
  fwrite(STDOUT, "My name is $input");
  exit(0);

$argc contains the number of arguments (including the script name), $argv contains the array of these (with the 0th element being the script name)

Template Systems

 
php.txt · Last modified: 2009/04/21 09:12 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki