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 use of inner join in mysql?

535


How to redirect https to http url and vice versa in .htaccess?

512


Explain how we can retrieve the data in the result set of mysql using php?

500


How many types of php are there?

518


Is php still relevant 2019?

538






Is php free to use?

536


How many types of php frameworks are there?

488


How to check a variable is array or not in php?

559


Is salary a ratio or interval?

547


When you want to show some part of a text displayed on an html page in red font color? What different possibilities are there to do this? What are the advantages/disadvantages of these methods?

507


Tell me what is the difference between the functions strstr() and stristr()?

531


Should I learn php before wordpress?

495


What is the use of offset in mysql?

522


How to redirect https to http url through .htaccess?

497


What is orm in php framework?

493