Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Print

print() is a PHP language construct used to output text to the browser or the output stream. It is often used to display information to users on a web page or to debug and inspect variable values during development. The print construct can be used in two forms: with or without parentheses.

print() is a language construct of PHP. It only accepts one argument and it returns 1.

print() also has a closely related function called print_r(), used for debugging.

<?php

    print 'Hello';
    
    print(' world!');

?>

Documentation

See Also