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. Очевидно, що це має бути використано тільки для тестування / налагодження.

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: Просто введіть ваші ім'я та адресу електронної пошти нижче:



and if you like it human-readable: і якщо вам сподобається людського розуміння:
echo “”; print_r($myarray); echo “”; Ехо ""; print_r ($ MyArray); Ехо "";
have fun! Have Fun!
this is more human-readable : Це більше людського розуміння:
echo ”; "Ехо";
print_r($array); print_r ($ Array);
echo ”; "Ехо";
You may want to try this: Ви можете спробувати наступне:
echo “”; Ехо "";
print_r($location); print_r ($ місцезнаходження);
echo “”; Ехо "";
echo “(html open tag)pre(html close tag)”; Ехо "(HTML-теги), попередньо (HTML закриває тег)";
print_r($location); print_r ($ місцезнаходження);
echo “\”; Ехо "\";
echo “(less than sign)pre(greater than sign)”; "Ехо" (менш знайомий) заздалегідь (більше знака) ";
print_r($location); print_r ($ місцезнаходження);
echo “(less than sign)/pre(greather than sign)”; "Ехо" (менш знайомий) / PRE (greather ніж знака) ";
between the quotes are the html pre tags (open and then close). між лапки HTML попередньо мітки (відкриті і закрийте).