Difference among echo, print and printf.



Difference among echo, print and printf...

Answer / amit kumar gaur

echo is the primitive of them and just output the content,
you can pass the multiple parameter.
<? php echo 'Welcome','to','india';?>

print is a construct(parentheses are optional)but it return
true and false,print does not the miultiple parameters.

printf is a function not a construct and allow advantage
formatted output.

echo is faster than others.

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More PHP Interview Questions

How do you parse and process html/xml in php?

0 Answers  


Tell me what does the php error 'parse error in php - unexpected t_variable at line x' means?

0 Answers  


What is difference between php and wordpress?

0 Answers  


What is string and its function?

0 Answers  


Dear Sir, i am a frasher and now i got a job offer from AentteQ Software Technologies for PHP developer.. so i am in confusion that is PHP correct for my carrer or i shud choose other then php for my carrer...plz suggest me

4 Answers   NIIT,






how we can retrive data in pdf along php mysql?

2 Answers  


Version of php, apache ,mysql

1 Answers  


How to pass variables and data from php to javascript?

0 Answers  


Is it necessary to use closing tag in php?sometime without closing tag things work.why?

2 Answers   ShopRite,


How can we submit a form without a submit button?

23 Answers   ABC, HCL, Infosys, Kept Bug, Panys, Rushmore Consultancy, Torque Infotech, Wipro, zCon Solutions,


What is php key?

0 Answers  


What is difference between core php and framework?

0 Answers  


Categories