Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP For printing out strings, there are echo, print and printf. Explain the differences.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


brijesh
For printing out strings, there are echo, print and printf. Explain the differences.
1 Answer(s)      3 years and 11 months ago
Posted in : PHP


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


Advertisement
View Answers

November 15, 2010 at 4:54 PM


Hi everyone,

The basic differences in echo, print, printf is:

echo : echo is a language construct(don't use paranthesis for echo).echo does not return any value.

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

printf : It 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.

Thanks



Related Tutorials/Questions & Answers:
For printing out strings, there are echo, print and printf. Explain the differences.
For printing out strings, there are echo, print and printf. Explain the differences.  For printing out strings, there are echo, print and printf. Explain the differences
echo and print statement
echo and print statement  hello, What is the difference between echo and print statement?   hii, echo() can take multiple expressions, Print() cannot take multiple expressions. And echo is a little bit faster
Advertisements
echo and print statement
echo and print statement  hello, What is the difference between echo and print statement
Print or Echo Functions in PHP
Print or Echo Function in PHP Although the use of both Print and Echo are same, but it has been seen that people uses echo command more then the print... that echo is bit faster then print command, as it does not return any value
What is the use of Print or Echo Function in PHP?
What is the use of Print or Echo Function in PHP?  Hi, Can anyone explain what is the use of print or Echo function in PHP? Please provide online reference for this. Thanks,   Hi, Although the use of both Print
How to print differences of two text files
How to print differences of two text files  I have the code to compare 2 different text files, however How can I put the difference of 2 text files in other file or print the difrference in the console?? Thanks
printf and println
printf and println  what is the differences between printf and println?   Hi Friend, The println prints the text on a new line, where as printf prints the text on the same line. Thanks
PHP Introduction to PHP Echo and print Tutorial
forms of outputting: print() and echo(). First... was written for. The first outputting function I will show you is print.... The basic structure of print() is:      <?php  
Print out html markup with h:outputText
Print out html markup with h:outputText  How to print out html markup with h:outputText
"$a dollars" or "{$a} dollars" to print out the amount of dollars.
"$a dollars" or "{$a} dollars" to print out the amount of dollars.  Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)  Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)
Can u print in turbo C  Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times
echo- Not a function
echo- Not a function       In php generally we use echo command to print something. echo is not a function...: This is multiple line Example: <?php echo "Hello world"."<br/>"
i want print the following out put
i want print the following out put  Hello sir i want the following out put can u provide the program in c# o/p; HELLOLLEH HELLLEH HELEH HEH H
PHP Echo Function
PHP Echo Function As you know echo () is one of the function of php, which is used to show the single or multiple strings on the browser. You can write the echo function as given below… <php Echo “hi how are you
strings
strings  difference between the strings in java and c
WRITE A PROGRAM TO PRINT OUT THE NUBERS 10 THROUGH 49
WRITE A PROGRAM TO PRINT OUT THE NUBERS 10 THROUGH 49   write a program to print out the number 10 through 49 in the following manner 10 11 12 13 ......19 20 21..............29 30 31..............39 40 4142............49
Strings
will contain strings which is separated by ",". From the main method invoke... one help me out and reply me soon plzzzzz
Take print out from printer at client machienusing jsp - JSP-Servlet
Take print out from printer at client machienusing jsp  Sir/Mam I want do is to take out print out of my report which will be created from the Mysql database with out displaying him/her the results or report from the printer
write an application that print out the even numbers between the range 100-200
write an application that print out the even numbers between the range 100-200   write an application that print out the even numbers between the range 100-200 ?   The given code accepts the number from 100 to 200
strings
strings  write a program in java to accept two strings as command line arguments and perform the following operations-: 1) compare the strings 2... is an example which accept two strings as command line arguments and perform
strings
strings   read sentence and convert all the word into capital case like camelcase   Hi Friend, Try the following code: import java.util.*; class ConvertWordsIntoUpperCase { public static String toCamelCase(String
strings
strings  Write a program to initialize 7 names in an array and their respective roll numbers in another array. Search for a roll number input by the user ,in the list ,If found display "Search Successful" and print the name along
strings
the corresponding mathematical operation and print the result. Hint : use the switch
printing in swing
printing in swing  How can i print payslip in swing
Printing stars
Printing stars  I am a beginer and i have one assignment which..." and print o/p as 0 - * 1- ** 2- * 4- ** 5-* 6-* I dont know how to split these strings in java so that i can put it in array..can somebody help
Echo 2
Echo 2       Echo 2 allows you to code Ajax apps in pure Java (Demo)which automatically generates HTML and Javascript. Read full Description
java code for print true if even and false if odd and print error if any float value with out using conditional and looping statement
java code for print true if even and false if odd and print error if any float value with out using conditional and looping statement  hi class Even{ public static void main(String[] arg){ int num=Integer.parseInt
What is 3D Printing?
3D printing is one of those technologies that made manual job with the objects... and in the meantime we lose the erstwhile sense of solid sensory reality. 3D printing... printing is done and what are the benefits of this great manufacturing technology
applet printing
applets gridwise and in each applet i am drawing some graph so while printing whole frame i am able to print all 3 applets together on one page but in each applet i... but while printing it is not getting printed on paper and rest everything
 

 

 

DMCA.com