answersLogoWhite

0

The print function is slightly more dynamic than the echo function by returning a value, and the echo function is slightly (very slightly) faster. The printf function inserts dynamic variables/whatever into wherever you want with special delimiters, such as %s, or %d. For example, printf('There is a difference between %s and %s', 'good', 'evil') would return 'There is a difference between good and evil'.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the difference between echo and printf command of UNIX?

Echo merely repeats its command line arguments as stated. The 'printf' command allows for formatted print and a more exacting method of printing out information. Printf requires you to specify the format of what you want to print; echo does not have this ability.


What is the difference between echo cat and cat echo commands in Linux?

echo cat will print out the word 'cat' on the command line. cat echo will attempt to list the contents of a file called 'echo'.


What is the difference between echo and print in PHP?

Print always returns a value of true, but echo doesn't. echo also has a short cut syntax meaning you can immediately follow the php tags by an equals sign and it will echo the result like in the example shown below: <?=$hello?>


What is the difference in accuracy between single and double beam echo sounder?

> You can use PHP variable name inside the double quote ("") Eg:- $name = 'Udit'; echo "Hello $name"; It will print: Hello Udit


What is the difference between echo and print statement?

Well, darling, an echo statement is a language construct in PHP that displays output, while a print statement is a language construct that also displays output but returns a value. So, in simpler terms, echo is faster and more commonly used, while print is slower but can be used in expressions. Hope that clears things up for you!


What is difference between echo and ' ' in unix?

Echo is a program. '' is not a program. '' does not perform any action. Echo returns what you type. '' does not.


What is the difference between sonar and echo location?

Sonar location is in the water and echo location is in the air.


What is a regular expression in PHP?

echo or print < both of which write text: <?php echo "TEXT"; print "TEXT"; ?>


Write a unix program to print print a pattern?

echo 'print a pattern'


How do you write a c program to swap the values of two variables in unix?

#include<stdio.h> void main() { int a=2,b=4; printf("Program for swapping two numbers "); printf("Numbers before swapping"); printf("a=%d and b=%d",a,b); a=((a+b)-(b=a)); printf("Numbers after swapping"); printf("a=%d and b=%d",a,b); getch(); }


What is the difference between rem and echo in batch?

rem is a comment that is only seen if you edit the batch echo actually is printed when the batch is running


What is difference between language constracter and function for exampal echo print in php language?

I think you mean language construct... Anyway, a function usually takes one or more arguments as comma separated values or variables. echo and print don't <?php $email = 'user@example.com'; $domain = strstr($email, '@'); echo $domain; // prints @example.com ?> Here the strstr function takes a variable string and a constant string as an argument. echo simply displays the contents of the resulting variable. There are a couple functions that don't require arguments, like die() & exit()