Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Different between the var_dump() and print_r()?

Answers were Sorted based on User's Feedback



Different between the var_dump() and print_r()?..

Answer / nagachowdary

var_dump() prints values and it's datatypes.in case of
print_r() it will print only values

Is This Answer Correct ?    23 Yes 3 No

Different between the var_dump() and print_r()?..

Answer / kiran

var_dump also displays the variable type (int, string,
array, etc.) and "length".

Examples: http://marc.info/?l=php-general&m=98684689426976&w=2
__________________

Is This Answer Correct ?    19 Yes 3 No

Different between the var_dump() and print_r()?..

Answer / 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

Different between the var_dump() and print_r()?..

Answer / 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

More PHP Interview Questions

how can I use bread crumb in PHP ?

2 Answers  


Explain mail function in PHP with syntax?

0 Answers  


How to find a substring from a given string in php?

0 Answers  


Does csrf token change?

0 Answers  


What are the features and advantages of object-oriented programming in php?

0 Answers  


What is use of count() function in php?

0 Answers  


What is the phpstorm?

0 Answers  


Draw the architecture of Zend engine?

4 Answers  


Can php replace javascript?

0 Answers  


how to register website in internet

2 Answers  


What are the advantages of stored procedures?

0 Answers  


What does $globals mean?

0 Answers  


Categories