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 cookie?

685


Is array a key php?

704


How can we connect to a mysql database from a php script?

757


What is the difference between nowdoc and heredoc?

721


What is the name of the scripting engine that powers PHP?

901


How to remove duplicate values from a PHP Array?

735


What are the advantages of stored procedures?

747


What are getters and setters php?

749


Tell me how do you define a constant?

697


How to randomly retrieve a value from an array?

730


Is key exist in array php?

712


How to select a database in php?

785


Do you know what is the function mysql_pconnect() usefull for?

688


What is the use of namespace in php?

719


Why super () is used in java?

708