PHP tutorials for beginners

It is impossible to jump in learning PHP before you know the basic concepts of HTML, and that is because when you code in PHP, your objective as a programmer is to output or generate an HTML page.

To explain by example, a table in HTML , you need to know how to produce a table in HTML first, and then with PHP becomes easy. with HTML it is static , you can list in a table a defined set of items and that is it; but with PHP you can list the items in a table dynamically, for example from a database, and that is the power of server side scripting like PHP.

Example of a table in HTML: a list of 2 provinces in Austria and their capital

<!-- Every table starts with the tag <table> -->
<table border="1">
<!-- Heading of the table with two labels "Province" and "Capital" -->
<!-- for HTML to recognize that you are starting a row -->
  <tr>  
    <th>Province</th>
    <th>Capital</th>    
  </tr>
<!-- End of the heading of the table -->
<!-- here are the rows containing the data -->
  <tr>
    <td>Burgenland</td>
    <td>Eisenstadt</td>
  </tr>
  <tr>
    <td>Tirol</td>
    <td>Innsbruck</td>
  </tr>
</table>

With PHP, you can produce the same list of provinces and their capital from a database but if you really do not know how HTML works, you cannot utilize PHP to produce the result.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.