nkm
0
Q:

php echo

<?php
  echo "Hello World!";
// You can also do this with a variable:
$YourVariable = "Hello World!";
echo $YourVariable;
?>
6
echo '';
3
print_r("");
0
<?php
echo "<h2>PHP is Fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This ", "string ", "was ", "made ", "with multiple parameters.";
?> 
2
<?php
  echo "your text";
?>
0
Source link:
https://www.programmingquest.com/2019/04/difference-between-echo-and-print.html

1. echo Statement
* we can write echo statement with parenthesis like 'echo()' or without parenthesis 'echo'.
* In the echo we can pass multiple variable in comma separated form to see the output like 'echo $a,$b,$c;'
* echo doesn’t return any value
* echo is faster then print

2. Print Statement
* we can write print statement with parenthesis like 'print()' or without parenthesis 'print'.
* In the print we can not pass multiple variable in comma separated form like echo.
* print statement always returns 1.
* print is slower than echo
1
<?php 
$string = "Hello, World!";
echo $string;
?>
1
<?php
  $hello = "HELO";
  echo "hello";
	if (youwantvar = on) {
    echo $hello
    }
  
  
  ?>
1
echo "Texto en php";
0
print ( string $arg ) : int
-1

New to Communities?

Join the community