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

For printing out strings, there are echo, print and printf.
Explain the differences.

Answer Posted / shilpa yogesh agrawal

echo, print and printf are used for printing strings but the
basic difference between them is: echo is the most primitive
of them, and just outputs the contents following the
construct to the screen. print is also a construct (so
parentheses are optional when calling it), but it returns
TRUE on successful output and FALSE if it was unable to
print out the string. And you can pass multiple parameters
to echo, like:

and it will output the string “Welcome Jack”

Whereas print does not take multiple parameters. It is also
generally argued that echo is faster, but usually the speed
advantage is negligible, and might not be there for future
versions of PHP.

printf&#65533; is a function, not a construct, and allows such
advantages as formatted output, but it’s the slowest way to
print out data out of echo, print and printf.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is multilevel inheritance possible in php?

962


Is php fully object oriented?

930


What is php used for?

959


What does nan stand for computer science?

981


How is traits used in php?

994


What is a helper function?

951


How many types of php frameworks are there?

920


Why is facebook still using php?

1090


What is mysql_real_escape_string used for?

981


What is the meaning of php?

934


Tell me what is needed to be able to use image function?

981


What is Gd PHP?

978


How do you define a constant?

968


How do I install php and apache on windows 10?

1071


What is magic quotes?

1010