Beginners, by echo grammar puzzles, view, ask you big God guidance!!!
The manual writes echo- output One or more strings, while strings have single quotes, double quotes, and delimiters.
Single quotes only output the characters themselves, and the double quotes will output the variables, which are detailed in the manual.
<?php
echo "Hello World";
echo "This spans
multiple lines. The newlines would be
output as well ";
//
echo "This spans\nmultiple lines. The newlines would be\noutput as well. ";
//
echo "Escaping characters is do \" like This\ ".";
//You can use variables in echo statements
$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!
Use single quotation marks to print variable names instead of values
Echo ' foo is $foo ';//foo are $foo
If you do not use any other characters, you can return only the variable
Echo $foo; Foobar
echo $foo, $bar; Foobarbarbaz
Strings can be passed or concatenated as multiple parameters individually and passed as a parameter
echo ' This ', ' string ', ' is ', ' made ', ' with multiple parameters ', CHR;
echo ' this '. ' String '. ' was '. ' Made '. ' with concatenation. ' "\ n";
//
Echo <<<end
This uses the ' Here Document ' syntax to output
multiple lines with $variable interpolation. Note
The here document Terminator must appear on a
Line with just a semicolon. No extra whitespace!
END;
Because the echo is not like a function, the following code is invalid.
($some _var)? Echo ' true ': echo ' false ';
However, the following example will work:
($some _var)? print ' true ': print ' false ';//print is also a construct, but
//It behaves like a function, so
//It is used in this context.
echo $some _var? ' True ': ' false '; Changing the statement around
?>
I wrote the code myself.
echo "{$match [0][0]}". " \ n "." {$match [0][1]} "." \ n "." {$match [0][2]} "." \ n "." {$match [0][3]} "." \ n "." {$match [0][4]} ";
echo "{$match [0][0]}", "\ n", "{$match [0][1]}", "\ n", "{$match [0][2]}", "\ n", "{$match [0][3]}", "\ n", "{$match [0][4]}";
It can be seen that different character-descriptor variables may be used in English. |, separated, with an escape character, so that each output an array on a line, to output an array, it is best to include braces.
can only be output as a continuous string
Echo ' wo Zai zhe '. \ n "." Huanhang ';
echo Simple usage in PHP