echo print_r and simple print_r
Posted: Thu Jul 30, 2015 2:55 am
In the following code
***** PLEASE USE PHP CODE TAG *****
i dont get a 1 at the end of the result but if i use the code echo print_r($a) i do get a 1 at the end. Which is the right way of coding and why is the one there?
***** PLEASE USE PHP CODE TAG *****
Code: Select all
<?php
$a=array(2,3,4,5,6,array(1,3,4,4,34,5,array(1,3,23,"cat",5,34)));
$a[5][6][3]="dog";
?>
<br><pre>
<?php
print_r($a);
?></pre>