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 In ấn các nội dung của một Array PHP

This is a pretty common task, but it's surprising how many PHP newbies don't know about it yet. Đây là một nhiệm vụ khá phổ biến, nhưng đáng ngạc nhiên bao nhiêu PHP newbies không biết về nó được nêu ra. If you want to see the structure of your PHP Array, all you need to do is this: Nếu bạn muốn xem cấu trúc của PHP Array của bạn, tất cả những gì bạn cần làm là:

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

This will give you a listing of all the items in the array, including multi-dimensional arrays. Điều này sẽ cung cấp cho bạn một danh sách của tất cả các mục trong mảng đó, bao gồm các mảng đa chiều. Obviously this should only be used for testing / debugging purposes. Rõ ràng là điều này chỉ nên được sử dụng để thử nghiệm / mục đích gỡ lỗi.

This article was originally written on 09/26/06 Tagged with: Bài viết này ban đầu được viết ngày 09/26/06 Tagged với: PHP PHP , , Programming Lập trình

Daily Email Updates Email cập nhật hàng ngày

You can get our how-to articles in your inbox each day for free. Bạn có thể làm thế nào chúng tôi vào các bài viết trong hộp thư của bạn mỗi ngày miễn phí. Just enter your name and email below: Chỉ cần nhập tên và email của bạn dưới đây:


Name: Tên:
Email: Email:

Comments (8) Bình luận (8)

  1. sven Sven

    and if you like it human-readable: và nếu bạn thích con người có thể đọc:
    echo “”; print_r($myarray); echo “”; echo ""; print_r ($ myarray); echo "";

    have fun! have fun!

  2. Magic.Crazy Magic.Crazy

    this is more human-readable : này là con người có thể đọc:

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

  3. Hmmmm Hmmmm

    You may want to try this: Bạn có thể muốn thử này:

    echo “”; echo "";
    print_r($location); print_r ($ vị trí);
    echo “”; echo "";

  4. Hmmmm Hmmmm

    echo “(html open tag)pre(html close tag)”; echo "(html mở khóa) trước (html tag đóng)";
    print_r($location); print_r ($ vị trí);
    echo “\”; echo "\";

  5. Hmmmm Hmmmm

    echo “(less than sign)pre(greater than sign)”; echo "(ít hơn ký) trước (lớn hơn ký)";
    print_r($location); print_r ($ vị trí);
    echo “(less than sign)/pre(greather than sign)”; echo "(ít hơn ký) / pre (greather hơn ký)";

  6. Hmmmm Hmmmm

    between the quotes are the html pre tags (open and then close). giữa dấu ngoặc kép được các thẻ html trước (mở và sau đó đóng).

  7. jeroen Jeroen

    surprising how very helpful this post is for php newbies like me đăng cách đáng ngạc nhiên rất hữu ích này là dành cho người mới php như tôi :)
    thx alot! thx rất nhiều!

  8. Jhm718 Jhm718

    This /is/ super helpful for PHP newbies like me. This / is / siêu hữu ích cho PHP newbies như tôi.

    Thanks! Cảm ơn!


Leave a Comment Để lại một Thảo luận




Leave your Để lại của bạn friendly thân thiện comment here. bình luận ở đây.

If you have a computer help question, Nếu bạn có một câu hỏi giúp máy tính, click here to leave it on the forums bấm vào đây để lại nó trên các diễn đàn instead. thay vì.

Note: Your comment may not show up immediately on the site. Lưu ý: Ý kiến của bạn có thể không hiển thị ngay lập tức trên trang web.

Our Friends Bạn bè của chúng tôi
Getting Started Bắt đầu


About How-To Geek Giới How-To Geek
What Is That Process? Quá trình đó là gì?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
mDNSResponder.exe mDNSResponder.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. Bản quyền © 2006-2009 HowToGeek.com. All Rights Reserved. Tất cả các quyền.