- print_r: documentation ( source)
<?php
// passing by reference
function computeValue( &$param ){
// Something goes here
foreach( $param as $k => $value){
$param[$k] = $value + 1;
}
}
$x = array();
for( $i =0; $i<99; $i++){
$x[$i] = $i;
}
computeValue( $x);
// array with 100 elements each incremented by 1
print_r( $x );
?>