Example 1 — Print a Message
The simplest use: show text on the screen.
<?php
print "Hello, CodeToFun!" . PHP_EOL;
print("Parentheses work too" . PHP_EOL); How It Works
- Write print and a string. No parentheses are needed.
- Add PHP_EOL. It ends the line.
- Try parentheses. They are allowed but not required.
- Both lines display. The output is the same either way.

