What PHP does
Posted on Wednesday, November 03, 2010 @ 23:05:42 CDT in PHP
by Raven
Southern writes: You can think of PHP as a general purpose computing language if you want to, but it was designed with one task in mind and it is almost exclusively used for that task - generating web pages. So while it might be more flattering to PHP to introduce it in the widest possible context this would be misleading and it would make the job of learning how to use it harder than it needs to be.
So let's say the obvious to make it 100% clear.
* PHP is a language that creates web pages.
What this means in practice is that a PHP program's objective in life is to generate HTML or Javascript or anything else that you might find in a web page. In most cases and certainly when you are first learning PHP the web technology that is used is HTML.
Again to state the obvious:
* The output of a typical PHP program is HTML
This means that to make any sense of PHP you also have to know about the web technology that the program is generating, and in particular HTML. In practice this shouldn't be a huge problem because HTML isn't difficult and mostly the way that PHP makes use of it is fairly simple. However, it is important to know that it is possible that you could have a problem with understanding a PHP program simply because you can't understand the HTML it is generating.
more: i-programmer