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 an array in php?

625


How check field is empty or not in php?

544


What is use of in_array() function in php?

541


What are Routines?

1780


What is mvc in php?

537






Explain how you can update memcached when you make changes to php?

564


What is sql injection in php?

535


Is php dying 2018?

550


Is php 5 still supported?

524


What is the difference between $var and $$var?

558


What is php default argument?

543


How can php and javascript interact?

751


What the use of var_dump()?

584


Do you know how to get the ip address of the client?

520


Is laravel easy to learn?

523