======print_r====== WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0 Dump the contents of an array to the current output ====Description==== print_r ( array $array ) Prints human-readable information about an array ====Parameter==== $array: The array to dump to the current output ====Return Values==== None ====Examples==== ===Create an array with key/value pairs and dump the contents to the current output===
The above example will output: [$arr] = Array ( (string) [name] => John (int) [age] => 30 (int) [status] => 1 ) ===Dump some different types of arrays===
The above example will output: [$arr1] = Array ( (string) [0] => Item 1 (string) [1] => Item 2 (string) [2] => Item 3 ) [$arr2] = Array ( (int) [0] => 1 (float) [1] => 2.500000 (float) [2] => 3.700000 (int) [3] => 4 ) [$arr3] = Array ( (string) [0] => one (int) [1] => 2 (float) [2] => 3.500000 [$arr2] = Array ( (int) [0] => 1 (float) [1] => 2.500000 (float) [2] => 3.700000 (int) [3] => 4 ) ) ====Note==== Although this function has other uses, it is most commonly used as a tool for testing and debugging new scripts. ====See Also==== [[array()]] - Create an array, with optional values [[array_key()]] - Return the key for an array index [[array_keys()]] - Return keys for an array that has key/value pairs [[explode()]] - Turn a string into an array [[implode()]] - Turn an array into a string [[indexed_array()]] - Create an array of a specific type and size [[is_array()]] - Check if a variable is an array [[json_encode()]] - JSON encode an array into a string, with optional method [[sizeof()]] - Return the number of elements in an array [[uphp:variables|uPHP Variable Types and Limits]]