Dumping an array to a web page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CptDondo

    Dumping an array to a web page

    Is there some quick way to dump an array to a webpage and have it show
    up neatly formatted rather than the typical blob-o-text?

    Thanks,

    --Yan
  • Rik

    #2
    Re: Dumping an array to a web page

    CptDondo <yan@NsOeSiPnAe Mr.comwrote:
    Is there some quick way to dump an array to a webpage and have it show
    up neatly formatted rather than the typical blob-o-text?
    >
    Thanks,
    >
    --Yan
    echo '<pre>';
    var_dump($var);
    echo '</pre>';


    --
    Rik Wasmus

    Comment

    • bob.chatman@gmail.com

      #3
      Re: Dumping an array to a web page

      On Jan 30, 12:28 pm, Rik <luiheidsgoe... @hotmail.comwro te:
      CptDondo <y...@NsOeSiPnA eMr.comwrote:
      Is there some quick way to dump an array to a webpage and have it show
      up neatly formatted rather than the typical blob-o-text?
      >
      Thanks,
      >
      --Yan
      >
      echo '<pre>';
      var_dump($var);
      echo '</pre>';
      >
      --
      Rik Wasmus
      there is also print_r() which is much nicer for arrays imo

      print "<pre>";
      print_r($arr);
      print "</pre>";

      Comment

      • Rik

        #4
        Re: Dumping an array to a web page

        bob.chatman@gma il.com <bob.chatman@gm ail.comwrote:
        On Jan 30, 12:28 pm, Rik <luiheidsgoe... @hotmail.comwro te:
        >CptDondo <y...@NsOeSiPnA eMr.comwrote:
        Is there some quick way to dump an array to a webpage and have it show
        up neatly formatted rather than the typical blob-o-text?
        >>
        Thanks,
        >>
        --Yan
        >>
        >echo '<pre>';
        >var_dump($var) ;
        >echo '</pre>';
        >>
        >--
        >Rik Wasmus
        >
        there is also print_r() which is much nicer for arrays imo
        >
        print "<pre>";
        print_r($arr);
        print "</pre>";
        Well, in my code it sometimes matters wether I have an integer '1' or a
        string '1', hence the var_dump.If you don't need it the layout of print_r
        is indeed somewhat 'nicer'.
        --
        Rik Wasmus

        Comment

        • Peter Fox

          #5
          Re: Dumping an array to a web page

          Following on from Rik's message. . .
          >Well, in my code it sometimes matters wether I have an integer '1' or a
          >string '1', hence the var_dump.If you don't need it the layout of print_r
          >is indeed somewhat 'nicer'.
          Please could you post a list of projects you've worked on so I can avoid
          having anything to do with them.

          --
          PETER FOX Not the same since the pancake business flopped
          peterfox@eminen t.demon.co.uk.n ot.this.bit.no. html
          2 Tees Close, Witham, Essex.
          Gravity beer in Essex <http://www.eminent.dem on.co.uk>

          Comment

          • Rik

            #6
            Re: Dumping an array to a web page

            Peter Fox <peterfox@emine nt.demon.co.uk. not.this.bit.no .htmlwrote:
            Following on from Rik's message. . .
            >Well, in my code it sometimes matters wether I have an integer '1' or a
            >string '1', hence the var_dump.If you don't need it the layout of
            >print_r
            >is indeed somewhat 'nicer'.
            >
            Please could you post a list of projects you've worked on so I can avoid
            having anything to do with them.
            Hey!

            It's by choice and design, not by PHP :P
            Sometimes I hate variable vars....
            --
            Rik Wasmus

            Comment

            Working...