PHP, the Hypertext Preprocessor, is a server-side scripting language (almost identical to the javascript "language") mainly used to transform data from files or databases to HTML output.
A client can interact with the server on submission of a form inside an html document. The form elements are inputs for the PHP functions.
The PHP equivalent of the previously stated JS function:
PHP code is in fact on the server-side embedded inside a template, setting the variables and deciding which blocks of HTML code to select/import in building the HTML site output (a page).
Embedded inside a HTML document, the example PHP code creates a site like this: