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
Why is php so popular?
What are the differences between php3 and php4 and php5? What is the current stable version of php? What advance thing in php7?
What is use of header() function in php? What the limitation of header()?
What is the use of offset in mysql?
What is ci in php?
What is the function of string in c?
What is php static function?
Explain the installation of PHP on UNIX systems?
What is the difference between $name and $$name?
Why do we use csrf token?
What is php in simple words?
Explain how can we execute a php script using command line?
List some features of php that are deprecated in php7?
What is the use of mvc in php?
Which methods should be used for sending an email using the variables $to, $subject, and $body?