34,333
edits
Changes
→How Does PHP Work?
echo '<h1>This line of HTML was generated by a PHP script embedded into an HTML document
?>
</body>
</html>
</pre>
The above example looks very miuch like standard HTML until the part surrounded by ''<?php'' and ''?>''. These are markers that designate where the PHP scriptlet begins and ends. When the web server finds this it sends it to the PHP module. the PHP module interprets it, converts it to HTML and sends it back to the web server. the web server then send sthe following to the browser:
<pre>
<html>
<head>
<title>A PHP Example</title>
</head>
<body>
<h1>This line of HTML was generated by a PHP script embedded into an HTML document
</body>