Different between the var_dump() and print_r()?

Answer Posted / nimesha

Print_r will display only values,but var_dump will display
data types too

Eg :
<?php
$a = array('aaa','bbb',11);
?>

Output of var_dump :
array(3) { [0]=> string(3) "aaa" [1]=> string(3) "bbb"
[2]=> int(11) }

Output of print_r :
Array ( [0] => aaa [1] => bbb [2] => 11 )

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of using php?

516


What is split function in php?

518


How is it possible to set an infinite execution time for php script?

528


How do you check if a variable has been set in php?

519


How is it possible to remove escape characters from a string?

582






What is chrome logger?

563


Tell me what does the array operator '===' means?

539


What is a php tag?

534


How escape single quotes php?

494


Explain Creating and Naming an Array?

598


What is difference between readonly and constant?

513


How easy is php?

532


Tell me what is the importance of "action" attribute in a html form?

542


How the result set of mysql be handled in php?

602


What is the difference between characters 34 and x34?

558