Possible Duplicate:
What’s the difference between echo, print, and print_r in PHP?
I am able to use both of these with seemingly the same effect. Is there a difference between the two? And is one preferred over the other?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The difference is that
print_rrecursively prints an array (or object, but it doesn’t look as nice), showing all keys and values.echodoes not, and is intended for scalar values.