php function PrintArray () cannot output object _php tutorial

Source: Internet
Author: User

php function PrintArray () Disadvantage: Cannot output object Print_r () can output object

  1. PrintArray ($_request);
  2. function PrintArray ($strs,
    $numbers = 0) {
  3. $ Space = '' ;//The space before the output character
  4. For ($i=0; $i<$numbers * 2; $i + +)
  5. $space . = ' ' ;
  6. Echo ' Array <br/> '. $space. ' (<br/>';
  7. foreach ($strs as $key=> $value) {
  8. if (Is_array ($value)) {
  9. $numbers + +;
  10. Echo $space. ' ['. $key. '] => ';
  11. PrintArray ($value, $numbers);
  12. } else {
  13. echo $space. ' ['. $key. '] => '
    . $value. ' <br/> ';
  14. }
  15. }
  16. Echo $space. ')<br/>';
  17. }

The contents of the PHP function PrintArray () output are as follows

 
 
  1. Array
  2. (
  3. [ECS] = > Array
  4. (
  5. [Visit_times] = > 2
  6. )
  7. [Uchome_loginuser] = > Yoyorose
  8. [Rrm_cookietime] = > 2592000
  9. [Rrm_indextype] = > Classics
  10. [Uchome_mytemplate] = > Blue
  11. [Rrm_loginuser] = > Yoyorose
  12. [Rrm_activationauth] = > 6f474pfbxw4ov
    /xdtu+eyomuxprcx6a+0gmr4sur/8glagurxa
  13. [Zdedebuggerpresent] = > php, phtml,php3
  14. [Uchome_auth] = > 821bvb9qfgrh+4uv07tq6q
    Cryk9oueem/j5gqxcjfmuzh3gptw6dp3phcqpufv
    Znyy3qctuw7h1vrlxeemqg
  15. [Uchome_viewuids] = > 10_1_2_4_11_8_9_7
  16. [Uchome_space_top_show] = > 1
  17. [Uchome_space_top_experience] = > 2
  18. )


http://www.bkjia.com/PHPjc/446020.html www.bkjia.com true http://www.bkjia.com/PHPjc/446020.html techarticle php function PrintArray () Disadvantage: Cannot output object Print_r () can output object PrintArray ($_request); Functionprintarray ($strs, $ numbers = 0) {$ space = ";//The space before the output character ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.