From the course: Learning PHP

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Printing on the screen

Printing on the screen - PHP Tutorial

From the course: Learning PHP

Start my 1-month free trial

Printing on the screen

- [Instructor] The most common task you'll perform in php is printing stuff on the screen. After all, your main goal is to create dynamic websites. The simplest way to print something out on the screen is to use a php echo statement. So I'll write my php opening tag, which is the less than sign, a question mark and then the letters php and then on a new line, I'll write echo hello world. Then I'll close my php tags. Echo tells php print out whatever follows this word. You can also see that there are single quotes around hello world. There are nuanced differences between a single and double quotes that you'll learn about later. Finally, this statement ends in a semicolon. This will be the case most of the time and you'll learn what the exceptions are later, but know that if you see an error, you may have missed a semicolon. There are a few other ways that you may see information printed in php. There's the shorthand…

Contents