1.What are the difference between echo , print , print_r ?
else this 3 can we show output to a client in some other
way?
Answers were Sorted based on User's Feedback
Answer / ajay
echo is a statement where print_r,print are the functions
which is prints all the variable result..
If the variable is an Array, then Print_r will prints the
array in details (Array[0]-> " the array values")...
where as the other two(echo and print) only prints as ARRAY().
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / ramesh
echo is not a function only it is display String Or integer Values
echo $record;
Array
print is a function it display the string and integer values it not applicable for loops and arrays
print($record);
Array
print_r is a return function it used for Strings and integers and as well as array of values and return object values
do u want effective retriview data from arrays use below statement
print_r($record);
Array ( [id] => 0 [date_details] => [password] => dasf [email] => sdfhhh )
echo "<pre>"; print_r($record);echo "</pre>";
Array
(
[id] => 0
[date_details] =>
[password] => dasf
[email] => sdfhhh
)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / meenakshi
echo is a statement
while print is a function
we can't print whole array by using echo or print. For this
we have to use the print_r function
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / madhavan
echo is a pure string statement, print is a formatted
function like C language by these two we cannot print whole
objects. We can print the whole object like array using print_r.
| Is This Answer Correct ? | 12 Yes | 18 No |
which will print out the php call stack?
client side scripting language Vs server side scripting language
Explain Whitespace Characters?
What is the use of trim function in php?
how to use between operator when retrieve from database(format-2008-jun-06)
How can I reset an array in PHP?
4 Answers Rushmore Consultancy, TCS,
what is the best function that can be used to connect to mysql database and in what cases that we can use below functions ? 1. mysql_connect() 2. mysql_pconnect() please give your answer with all pros and cons
how to upload 100mb file using .htaccess..
How to remove blank spaces from the string?
how to insert, update data in database
Which library is used in php to do various types of image work?
Is php a low level language?