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...

What is the Diff. Between echo() and Print() in PHP?

Answer Posted / vinay sachan

There are many differences in print() and echo() :-

1-echo is unformatted whereas print is formatted.

2-echo() can take multiple expressions, Print cannot take multiple expressions.
ex.-
<?php
$name="Vinay";
echo "Name is $name";
//Value is Vinay

print 'Name is $name';
//Value is $name
?>

3-Print return true or false based on success or failure whereas echo just does what its told without letting you know whether or not it worked properly.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is filter_var?

925


What are some new features introduced in php7?

8731


Can php variables have numbers?

950


Is facebook still written in php?

927


I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what is the problem?

915


What is the use of return in php?

861


What are the characteristics of php variables?

1013


How many types of session are there?

985


What is PHP? Who is the father or inventor of PHP?

991


Is php faster than javascript?

886


What is cms php?

899


What is the difference between implode() and explode() in php?

955


How to get useful error messages in php?

1009


What is the function file_get_contents() useful for?

882


Differentiate between require and include?

922