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 can you retrieve a cookie value?
What is difference between variable declaration and variable definition?
How does php isset work?
What is a controller php?
What is the interface in php?
i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..
What is cookie in php with example?
What is put method in php?
Explain Whitespace Characters?
What is the function of string in c?
How to download file in php?
What are the advantages of stored procedures, triggers, indexes in php?
Explain about the connective abilities of the PHP?
How can I increase my website session?
How to check if a string contains a character or word in php?