Answer Posted / rubina
The difference between the two is:
Var_dump() returns the datatype also of the variable which
print_r() does not.
Eg:
$query="Select fname from table where id=20";
$result=mysql_query($query);
$row=mysql_fetch_row($result);
print_r($query);
o/p
---------------
SELECT fname FROM information where id=53
var_dump($query);
o/p
----------------
string(43) " SELECT fname FROM information where id=53"
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is the difference between php traits vs interfaces?
How To Get the Uploaded File Information in the Receiving Script?
Difference between get and post method.
What is the name of the scripting engine that powers PHP?
What is php mainly used for?
When do you use define() and when do you use const. What are the main differences between those two?
What is the current stable version of php?
What is difference between php and html?
Maine 12th ke bad 2 years ka web designing ka course kiya hai. Php me achcha hu. Ek fresher ko is field me kitna mil sakta hai ?
Why do we need abstract class in php?
What are differences between PECL and PEAR?
How can we destroy the cookie in php?
Explain which cryptographic extension provide generation and verification of digital signatures?
What is the difference between htmlentities and htmlspecialchars in php?
What is the use of token in php?