How does PHP Work?
<p>We have all seen many question on StackOverflow that are founded upon the idea that PHP works like Javascript. Where the person clearly does not understand that PHP is a <em>Preproccessor</em> and only works before the page is sent out. </p>

<p>A clear example of this is in the following code, where <code>runCommand()</code> will not run when the user presses the button.</p>

<pre><code>&lt;a href="&lt;?php runCommand(); ?&gt;"&gt;Click Me!&lt;/a&gt;
</code></pre>

<p>as it would in Javascript</p>

<pre><code>&lt;a href="javascript:runCommand();"&gt;Click Me!&lt;/a&gt;
</code></pre>

<p>I've seen many questions like this that are from new people that just simply don't realize 'how' PHP works. </p>

<p>My question is: <strong>Where is a great resource that explains how PHP works?</strong>. </p>

<p>I want to be able to redirect people to a page that can get them going on the correct track and know what being a <em>Preproccessor</em> means.</p>

<p><em>(This also allows me to be lazy and not have to write an explanation every time it comes up, but don't tell anyone!)</em></p>

<p>If you don't know of a place that describes this well, feel free to provide your own interpretation.</p>

<p>As <strong>Carl Smotricz</strong> points out, there is a part of PHP that can be used outside of the browser. But I'm mainly talking about in a Apache enviorment where a user requests a web page, and expects to get something back, usually in HTML.</p>
