Home > Backend Development > PHP Tutorial > PHP function printarray() cannot output objects_PHP tutorial

PHP function printarray() cannot output objects_PHP tutorial

WBOY
Release: 2016-07-15 13:33:53
Original
1264 people have browsed it

Disadvantages of PHP function printarray(): cannot output objects print_r() can output objects

  1. printarray($_REQUEST); 🎜> =
  2. 0
    ) { $space =
  3. ''
  4. ; //Output the space before the character for($i=
  5. 0
  6. ;$i<$numbers * 2;$i++) $space .=
  7. ' '
  8. ; echo ' Array<br/>
  9. '.$space.'( <br/>'; foreach ($strs as $key=
  10. > $value ) { if (is_array ( $value )) { $numbers ++; echo $space. '['.$key.'] =
  11. >
  12. ';
  13. printarray($value, $numbers); } else { 🎜>echo $space.' ['.$key.']=>
  14. '
  15. .$ value.'
  16. <
  17. br/>';
    } } echo $space. ') <
  18. br/>
  19. '; >
  20. The output of PHP function printarray() is as follows http://www.bkjia.com/PHPjc/446020.html
  21. www.bkjia.comtrue
http: //www.bkjia.com/PHPjc/446020.html

TechArticle

PHP function printarray() Disadvantages: Cannot output objects print_r() can output objects printarray($_REQUEST); functionprintarray( $strs, $ numbers = 0 ){ $ space = '' ;//Output the space before the character...

<ol class="dp-xml">
<li class="alt"><span><span>Array   </span></span></li>
<li><span>(   </span></li>
<li class="alt">
<span>[ECS] =</span><span class="tag">></span><span> Array   </span>
</li>
<li><span>(   </span></li>
<li class="alt">
<span>[visit_times] =</span><span class="tag">></span><span> 2   </span>
</li>
<li><span>)   </span></li>
<li class="alt">
<span>[uchome_loginuser] =</span><span class="tag">></span><span> yoyorose   </span>
</li>
<li>
<span>[rrm_cookietime] =</span><span class="tag">></span><span> 2592000   </span>
</li>
<li class="alt">
<span>[rrm_indextype] =</span><span class="tag">></span><span> classics   </span>
</li>
<li>
<span>[uchome_mytemplate] =</span><span class="tag">></span><span> blue   </span>
</li>
<li class="alt">
<span>[rrm_loginuser] =</span><span class="tag">></span><span> yoyorose   </span>
</li>
<li>
<span>[rrm_activationauth] =</span><span class="tag">></span><span> 6f474pFbxW4oV<br>/XdtU+eyoMUxpRCx6A+0GMR4SUR/8GlagURxA   </span>
</li>
<li class="alt">
<span>[ZDEDebuggerPresent] =</span><span class="tag">></span><span> </span>PHP<span>,phtml,</span>PHP<span>3   </span>
</li>
<li>
<span>[uchome_auth] =</span><span class="tag">></span><span> 821bVB9QFgrH+4uv07tQ6q<br>CRYK9OueeM/j5gqXCJfmUZh3gptW6dP3phCqPufV<br>ZnYY3qCtuW7h1vrLxEemQG   </span>
</li>
<li class="alt">
<span>[uchome_viewuids] =</span><span class="tag">></span><span> 10_1_2_4_11_8_9_7   </span>
</li>
<li>
<span>[uchome_space_top_show] =</span><span class="tag">></span><span> 1   </span>
</li>
<li class="alt">
<span>[uchome_space_top_experience] =</span><span class="tag">></span><span> 2   </span>
</li>
<li><span>)  </span></li>
</ol>
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template