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
How to convert one date format into another in php?
What is an abstract class in php?
What does the function get_magic_quotes_gpc() means?
What is an anti csrf token?
Is php dying 2018?
How to get complete current page url in php?
What is session data?
What distinguishes php from something like client side java script?
What is php rest api?
Which function would you use to merge two arrays in php?
Does php support multithreading?
Explain Traits in PHP?
Is empty check in php?
Does session expire on closing browser?
How many php functions are there?