Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2004, 04:26 PM
Authorized User
 
Join Date: Jan 2004
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

 
Old January 3rd, 2004, 04:59 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
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
:::::::::::::::::::::::::::::::::
 
Old January 3rd, 2004, 07:01 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
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
:::::::::::::::::::::::::::::::::
 
Old January 4th, 2004, 05:44 PM
Authorized User
 
Join Date: Jan 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok. Thanks.






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





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