How can I print all the values of an array? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
开发者_Python百科 Improve this questionI have an array and print_r won't display the raw text, how can I print all the values in an array (e.g. pie)
So many ways to do it...
foreach ($array as $item) {
echo $item;
}
echo join(', ', $array);
array_walk($array, create_function('$a', 'echo $a;'));
Maybe you just need some <pre>
tags:
echo '<pre>';
print_r($arr);
echo '</pre>';
<?php
$len=count($pie);
for ($i=0;$i<$len;$i++)
echo $pie[$i];
?>
精彩评论