- Published by
- Posted on
- 2 Comments
This PHP Tutorial will give you some information about “PHP print_r() function”, which includes Syntax, Examples, Usage and output. The print_r() will print any array including multidimensional Arrays. The return parameter will let you capture the output of print_r(). When this parameter is set to TRUE, print_r() will return the information rather than print it.
mixed print_r ( mixed $expression [, bool $return = false ] )
PHP print_r() Function
'Certification ', 'b' => 'Paths', 'c' => array ('ccna', 'ccnp', 'ccie')); print_r ($myar); ?>
Array ( [a] => This php code [b] => is written by [c] => Array (  => noob  => prof  => expert ) )
Or you can use another variable to store output from print_r and later echo it to get the above output again.
$results = print_r($myar, true);