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 Skriva ut innehållet i ett PHP Array

This is a pretty common task, but it's surprising how many PHP newbies don't know about it yet. Detta är en ganska gemensam uppgift, men det är förvånande hur många PHP nybörjare inte vet om det än. If you want to see the structure of your PHP Array, all you need to do is this: Om du vill se strukturen på din PHP Array, allt du behöver göra är detta:

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

This will give you a listing of all the items in the array, including multi-dimensional arrays. Detta kommer att ge dig en lista över alla objekt i kedjan, inklusive flerdimensionella arrayer. Obviously this should only be used for testing / debugging purposes. Självklart gäller detta bör endast användas för att testa / felsöka.

This article was originally written on 09/26/06 Tagged with: Denna artikel skrevs ursprungligen på 09/26/06 Märkta med: PHP PHP , , Programming Programmering

Daily Email Updates Dagligt Updates

You can get our how-to articles in your inbox each day for free. Du kan få våra instruktioner artiklar i din inkorg varje dag gratis. Just enter your name and email below: Skriv bara in ditt namn och e-postadress nedan:


Name: Namn:
Email: Email:

Comments (6) Kommentarer (6)

  1. sven sven

    and if you like it human-readable: och om du gillar det läsbara:
    echo “”; print_r($myarray); echo “”; echo ""; print_r ($ MyArray) echo "";

    have fun! have fun!

  2. Magic.Crazy Magic.Crazy

    this is more human-readable : detta är mer läsbara:

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

  3. Hmmmm Hmmmm

    You may want to try this: Du kanske vill prova detta:

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

  4. Hmmmm Hmmmm

    echo “(html open tag)pre(html close tag)”; echo "(html öppen tag) före (html tagg)";
    print_r($location); print_r ($ location);
    echo “\”; echo "\";

  5. Hmmmm Hmmmm

    echo “(less than sign)pre(greater than sign)”; echo "(mindre än-tecken) före (större än-tecken)";
    print_r($location); print_r ($ location);
    echo “(less than sign)/pre(greather than sign)”; echo "(mindre än-tecken) / pre (greather än-tecken)";

  6. Hmmmm Hmmmm

    between the quotes are the html pre tags (open and then close). mellan citationstecknen är html pre taggar (öppna och stäng sedan).


Leave a Comment Lämna en kommentar




Leave your Lämna ditt friendly friendly comment here. kommentar här.

If you have a computer help question, Om du har en dator hjälp fråga, click here to leave it on the forums Klicka här för att lämna det i forumen instead. istället.

Note: Your comment may not show up immediately on the site. Obs: Din kommentar inte får visa upp omedelbart på platsen.

Our Friends Our Friends
Getting Started Komma igång


About How-To Geek Om How-To Geek
What Is That Process? Hur skall den processen?
svchost.exe svchost.exe
jusched.exe SynTPEnh.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.