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 purpose of pear in php?
How can we encrypt the password using php?
Is it possible to remove the html tags from data?
What is the use of namespace in php?
Tell me what does the php error 'parse error in php - unexpected t_variable at line x' means?
What is difference between web service and api?
Which framework is best for php development?
Is there an easy way to delete an element from a php array?
How many different types of messages available in php?
What is $this in php?
Which cryptographic extension provide generation and verification of digital signatures?
which will print out the php call stack?
How can you execute php script from the command line?
Which operator is used to concatenate two strings in PHP?
Is php better than python?