Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 3rd, 2004, 04:26 PM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Output Difference

Hi, I'm been writing PHP for about 2 weeks now. I seem to learn something new each day. Anyway,

One poster said to use print_r and var_dump rather than echo. I just what to know why we should use those functions rather than echo? What's the main difference between them?

Thanks

Reply With Quote
  #2 (permalink)  
Old January 3rd, 2004, 04:59 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Use var_dump or print_r if you want to view the structure of an array or an object.

http://www.php.net/var_dump
http://www.php.net/print_r

These do not work in place of echo! These are utility functions that provide information about a variable. Perhaps you are thinking of print. Whereas print and echo are language constructs, not functions, these are functions.

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #3 (permalink)  
Old January 3rd, 2004, 07:01 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Also, be sure to check out the following links:

http://www.php.net/echo
http://www.php.net/print

And for a detailed explaination of the differences between the two:
http://www.faqts.com/knowledge_base/...l/aid/1/fid/40

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #4 (permalink)  
Old January 4th, 2004, 05:44 PM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok. Thanks.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between C# and C++ SolarEnergy Visual C++ 2005 3 April 7th, 2007 09:45 AM
difference Magen Classic ASP Basics 2 January 29th, 2007 04:48 PM
what is the difference? chuck_schuldiner Javascript How-To 2 February 10th, 2005 01:46 AM
what is the difference between... chuck_schuldiner Javascript 2 February 10th, 2005 01:41 AM
What is the difference between these two? ramk_1978 SQL Language 1 January 14th, 2005 11:16 AM



All times are GMT -4. The time now is 10:52 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.