Hello World!
Part of the Fundamentals section of Coddy's PHP journey — lesson 2 of 71.
The "Hello World!" is a simple program that outputs Hello World! to the screen.
In PHP, we use echo to show words on the screen. The words go inside quotation marks.
Let's take a look at the "Hello World!" program in PHP:
<?php
echo "Hello World!";
?>Challenge
EasyUse the code view to write a program that outputs Hello World!
Note that anything inside quotation marks is case sensitive. For example:
<?php echo "Hello World!"; ?><?php echo "hello world!"; ?>are different things (notice the capital letters in the first line).
Cheat sheet
To output text in PHP use echo:
<?php
echo "Hello World!";
?>Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
4Comparison & Logical Operators
Comparison OperatorsEquality & IdentityLogical Operators Part 1Logical Operators Part 2Recap - Simple Logic2Variables and Data Types
NumbersStrings and QuotesBooleansNaming ConventionsRecap - Variable InitEmpty VariablesString ConcatenationGetting User InputCast to Different Types5Conditional Logic
If StatementIf - ElseThe Ternary OperatorNull Coalescing OperatorSwitch StatementRecap - Making Decisions3Basic Operators
Arithmetic OperatorsModulo OperatorExponentiation OperatorCombined AssignmentIncrement/DecrementOperator PrecedenceRecap - Simple CalculationsString Operators