Subscribe to How-To Geek Підписатись на How-To Geek

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 Друк вмісту PHP Array

This is a pretty common task, but it's surprising how many PHP newbies don't know about it yet. Це досить поширена завдання, але дивно, як багато новачків PHP не знаю про це не йде. If you want to see the structure of your PHP Array, all you need to do is this: Якщо ви хочете побачити структуру вашого PHP Array, все, що вам потрібно зробити, це:

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

This will give you a listing of all the items in the array, including multi-dimensional arrays. Це дасть вам список всіх елементів у масиві, у тому числі багатовимірні масиви. Obviously this should only be used for testing / debugging purposes. Очевидно, що це має бути використано тільки для тестування / налагодження.

This article was originally written on 09/26/06 Tagged with: Ця стаття була спочатку написана на 09/26/06 тегами: PHP PHP , , Programming Програмування

Daily Email Updates Email Щоденні оновлення

You can get our how-to articles in your inbox each day for free. Ви можете отримати наші довідкові статті у Вашу поштову скриньку щодня безкоштовно. Just enter your name and email below: Просто введіть ваші ім'я та адресу електронної пошти нижче:


Name: Ім'я:
Email: Електронна пошта:

Comments (6) Коментарі (6)

  1. sven Sven

    and if you like it human-readable: і якщо вам сподобається людського розуміння:
    echo “”; print_r($myarray); echo “”; Ехо ""; print_r ($ MyArray); Ехо "";

    have fun! Have Fun!

  2. Magic.Crazy Magic.Crazy

    this is more human-readable : Це більше людського розуміння:

    echo ”; "Ехо";
    print_r($array); print_r ($ Array);
    echo ”; "Ехо";

  3. Hmmmm Хммм

    You may want to try this: Ви можете спробувати наступне:

    echo “”; Ехо "";
    print_r($location); print_r ($ місцезнаходження);
    echo “”; Ехо "";

  4. Hmmmm Хммм

    echo “(html open tag)pre(html close tag)”; Ехо "(HTML-теги), попередньо (HTML закриває тег)";
    print_r($location); print_r ($ місцезнаходження);
    echo “\”; Ехо "\";

  5. Hmmmm Хммм

    echo “(less than sign)pre(greater than sign)”; "Ехо" (менш знайомий) заздалегідь (більше знака) ";
    print_r($location); print_r ($ місцезнаходження);
    echo “(less than sign)/pre(greather than sign)”; "Ехо" (менш знайомий) / PRE (greather ніж знака) ";

  6. Hmmmm Хммм

    between the quotes are the html pre tags (open and then close). між лапки HTML попередньо мітки (відкриті і закрийте).


Leave a Comment Залишити коментар




Leave your Залиш свій friendly дружній comment here. коментарі.

If you have a computer help question, Якщо у вас є комп'ютер допоможе питання, click here to leave it on the forums Натисніть тут, щоб залишити його на форумах instead. замість.

Note: Your comment may not show up immediately on the site. Примітка: Ваш коментар може не з'явитися відразу на місці.

Our Friends Наші друзі
Getting Started Приступаючи до роботи


About How-To Geek Про How-To Geek
What Is That 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. Всі права захищені.