mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-22 23:01:41 +03:00
[php/en]
Line 159 - echo isn't a function, print() is Line 337 - unneeded semicolon (it's a pre-test loop)
This commit is contained in:
parent
f0a4c88acf
commit
5afca01bdf
@ -3,6 +3,7 @@ language: PHP
|
||||
contributors:
|
||||
- ["Malcolm Fell", "http://emarref.net/"]
|
||||
- ["Trismegiste", "https://github.com/Trismegiste"]
|
||||
- [ Liam Demafelix , https://liamdemafelix.com/]
|
||||
filename: learnphp.php
|
||||
---
|
||||
|
||||
@ -156,14 +157,13 @@ unset($array[3]);
|
||||
* Output
|
||||
*/
|
||||
|
||||
echo('Hello World!');
|
||||
echo 'Hello World!';
|
||||
// Prints Hello World! to stdout.
|
||||
// Stdout is the web page if running in a browser.
|
||||
|
||||
print('Hello World!'); // The same as echo
|
||||
|
||||
// echo and print are language constructs too, so you can drop the parentheses
|
||||
echo 'Hello World!';
|
||||
// print is a language construct too, so you can drop the parentheses
|
||||
print 'Hello World!';
|
||||
|
||||
$paragraph = 'paragraph';
|
||||
@ -335,7 +335,7 @@ switch ($x) {
|
||||
$i = 0;
|
||||
while ($i < 5) {
|
||||
echo $i++;
|
||||
}; // Prints "01234"
|
||||
} // Prints "01234"
|
||||
|
||||
echo "\n";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user