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 default session time and path in php?
Explain the advantages of using PHP?
Tell us how to create an array of a group of items inside an html form?
How can we determine whether a php variable is an instantiated object of a certain class?
How to get a total number of elements used in the array?
How long will it take to learn php?
What is difference between rest api and restful api?
Is php a framework?
Differences between get, post and request methods ?
What is better .net or php?
Is it difficult to learn php?
Is PHP an open source software?
How many keywords are there in php?
What are the new features available in php 7?
Are parent constructors called implicitly inside a class constructor?