Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Printing the contents of a PHP Array Tiskanje vsebino PHP Array

This is a pretty common task, but it's surprising how many PHP newbies don't know about it yet. To je lepa skupna naloga, vendar je presenetljivo, koliko PHP newbies ne vem o tem še ni. If you want to see the structure of your PHP Array, all you need to do is this: Če želite videti strukturo vašega PHP Array, vse, kar morate storiti, je to:

print_r($myarray); print_r ($ myarray);

This will give you a listing of all the items in the array, including multi-dimensional arrays. To vam bo dala seznam vseh elementov v matriki, vključno z multi-dimenzionalno nizi. Obviously this should only be used for testing / debugging purposes. Očitno je to le mogoče uporabiti za testiranje / debugging namene.

This article was originally written on 09/26/06 Tagged with: Ta članek je bil prvotno napisan na 09/26/06 Tagged with: PHP PHP , , Programming Programming

Daily Email Updates Dnevni Email Updates

You can get our how-to articles in your inbox each day for free. Lahko dobite našo kako do člankov v vašo mapo »Prejeto vsak dan brezplačno. Just enter your name and email below: Preprosto vpišite vaše ime in e-pošto spodaj:


Name: Ime:
Email: E-pošta:

Comments (8) Komentarji (8)

  1. sven Sven

    and if you like it human-readable: in če ti je všeč, berljiv:
    echo “”; print_r($myarray); echo “”; echo ""; print_r ($ myarray); echo "";

    have fun! Have fun!

  2. Magic.Crazy Magic.Crazy

    this is more human-readable : to je bolj berljiv:

    echo ”; echo ";
    print_r($array); print_r ($ array);
    echo ”; echo ";

  3. Hmmmm Hmmmm

    You may want to try this: Morda boste želeli poskusiti to:

    echo “”; echo "";
    print_r($location); print_r ($ lokacija);
    echo “”; echo "";

  4. Hmmmm Hmmmm

    echo “(html open tag)pre(html close tag)”; echo "(html tag odprti) pre (html tag blizu),";
    print_r($location); print_r ($ lokacija);
    echo “\”; echo "\";

  5. Hmmmm Hmmmm

    echo “(less than sign)pre(greater than sign)”; echo "(manj kot znak) pre (več kot znak)";
    print_r($location); print_r ($ lokacija);
    echo “(less than sign)/pre(greather than sign)”; echo "(manj kot znak) / pre (greather kot znak)";

  6. Hmmmm Hmmmm

    between the quotes are the html pre tags (open and then close). navaja, so med predhodno html oznake (na prostem in zaprite).

  7. jeroen Jeroen

    surprising how very helpful this post is for php newbies like me presenetljivo, kako zelo koristno za to delovno mesto php newbies, kot sem jaz :)
    thx alot! thx veliko!

  8. Jhm718 Jhm718

    This /is/ super helpful for PHP newbies like me. Ta / se / super koristno za newbies PHP, kot sem jaz.

    Thanks! Hvala!


Leave a Comment Pustite komentar




Leave your Pustite friendly prijazen comment here. comment here.

If you have a computer help question, Če imate računalnik pomagati vprašanje, click here to leave it on the forums kliknite tukaj, da ga pustijo na forumih instead. namesto.

Note: Your comment may not show up immediately on the site. Opomba: Tvoj komentar morda ne pokažejo takoj na mestu.

Our Friends Naši prijatelji
Getting Started Getting Started


About How-To Geek O Kako naj Geek
What Is That Process? Kaj je to proces?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe Ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.