Echo"Hello World";
Echo"This spans
Multiple lines. The newlines would be
Output as well ";
Echo"This spansmultiple lines. The newlines would beoutput as well. ";
Echo"Escaping characters is do" like this ".";
//You can use variables inside of an echo statement
$foo= "Foobar";
$bar= "Barbaz";
Echo"Foo is$foo"; //foo is Foobar
can also use arrays
$baz= Array ("Value"="foo");
Echo" This is{$baz[value]} !"; //This is Foo!
Using single quotes would print the variable name, not the value
EchoFoo is $foo; Foo is $foo
If you aren't using any other characters, you can just echo variables
Echo$foo; //Foobar
Echo$foo,$bar; //Foobarbarbaz
Some people prefer passing multiple parameters to echo over concatenation.
Echo This, string, was, made, With multiple parameters., CHR(Ten);
Echo This. string. was. made. With concatenation.. "";
Echo <<<>
This uses the ' Here Document ' syntax to output
Multiple lines with$variableinterpolation. Note
The here document Terminator must appear on a
Line with just a semicolon. No extra whitespace!
END;
Because Echo does not behave as a function, the following code is invalid.
($some _var) ? Echotrue: Echofalse;
//However, the following examples would work:
($some _var) ? Printtrue: Printfalse; //Print is also a construct, but
It behaves like a function, so
It is used in the this context.
Echo$some _var? true: false; //Changing the statement around
?>
====================
PHP die () function<>< p=""><>
http://www.bkjia.com/PHPjc/486540.html www.bkjia.com true http://www.bkjia.com/PHPjc/486540.html techarticle ? PHP echo Hello World, echo this spans multiple lines. The newlines would be output as well; echo This spansmultiple lines. The newlines would beoutput as well. ; Echo Escaping cha ...