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 Printing saturu PHP Array

This is a pretty common task, but it's surprising how many PHP newbies don't know about it yet. Tas ir diezgan kopīgais uzdevums, bet tas ir pārsteidzoši, cik daudz PHP newbies nezinu par to vēl. If you want to see the structure of your PHP Array, all you need to do is this: Ja jūs vēlaties redzēt struktūra jūsu PHP Array, viss, kas jums jādara, ir šādi:

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

This will give you a listing of all the items in the array, including multi-dimensional arrays. Tas dos Jums uzskaitot visu posteņu masīvs, tostarp vairāku dimensiju masīvus. Obviously this should only be used for testing / debugging purposes. Acīmredzot tas būtu jāizmanto tikai testēšanas / atkļūdošanas vajadzībām.

This article was originally written on 09/26/06 Tagged with: Šis pants tika sākotnēji rakstīts uz 09/26/06 tagged with: PHP PHP , , Programming Programmēšana

Daily Email Updates Daily Email Updates

You can get our how-to articles in your inbox each day for free. Jūs varat saņemt mūsu how-to rakstus savā pastkastītē katru dienu par brīvu. Just enter your name and email below: Vienkārši ievadiet jūsu vārdu un e-pasta zemāk:


Name: Vārds:
Email: E-pasts:

Comments (6) Komentāri (6)

  1. sven Sven

    and if you like it human-readable: un ja tev tas patīk cilvēku lasāms:
    echo “”; print_r($myarray); echo “”; echo ""; print_r ($ myarray) echo "";

    have fun! have fun!

  2. Magic.Crazy Magic.Crazy

    this is more human-readable : tas vairāk cilvēku lasāms:

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

  3. Hmmmm Hmmmm

    You may want to try this: Jūs varat mēģināt šo:

    echo “”; echo "";
    print_r($location); print_r ($ atrašanās vieta);
    echo “”; echo "";

  4. Hmmmm Hmmmm

    echo “(html open tag)pre(html close tag)”; echo "(html atvērt tag) iepriekšējā (html tuvu tag)";
    print_r($location); print_r ($ atrašanās vieta);
    echo “\”; echo "\";

  5. Hmmmm Hmmmm

    echo “(less than sign)pre(greater than sign)”; echo "(mazāk nekā zīme) pre (vairāk nekā zīme)";
    print_r($location); print_r ($ atrašanās vieta);
    echo “(less than sign)/pre(greather than sign)”; echo "(mazāk nekā zīme) / pre (greather nekā zīme)";

  6. Hmmmm Hmmmm

    between the quotes are the html pre tags (open and then close). starp pēdiņām ir html pre tagus (atvērt un pēc tam aizveriet).


Leave a Comment Leave Comment




Leave your Atstājiet savu friendly draudzīgs comment here. komentārus šeit.

If you have a computer help question, Ja Jums ir dators palīdzēt jautājumu, click here to leave it on the forums click here to atstāt uz forumu instead. vietā.

Note: Your comment may not show up immediately on the site. Piezīme: Jūsu komentārs var neparādīties pat tieši uz vietas.

Our Friends Our Friends
Getting Started Getting Started


About How-To Geek Par How-To Geek
What Is That Process? Kas ir šis process?
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.