PHP for beginners

Written by Joe on Tuesday, February 2, 2010

PHP is a server-side programming language used to create HTML pages.  Server-side  languages use server memory, rather than using your computers memory.  PHP can be used for tasks such as reading data passed from html forms, reading information from a database, file manipulation and more.

PHP can be embedded into any HTML page.  All you have to do is change the file extension from .html to .php.  All php code must be wrapped in (<?php ?>) tags.  Here is a simple php script to get started with.  Visit php.net to learn more about php.

<?php

    //This is a single line comment

    /*********************************************************

    This is a block comment

    **********************************************************/

    //This is how you print to the screen
    echo "Hello world!";

    //This is how you declare variables
    $first_name = "John";
    $last_name = "John";

    //This is how you get todays date
    $todays_date = date("Y-m-d");

    //Print all of the variables to the screen
    echo "Hello ".$first_name." ".$last_name." today is ".$todays_date;

?>

Like what you’ve read?

Link back to us.
http://www.revolutionunlimited.com/news-and-articles/php/2010-02-02/php-for-beginners/

OR Join Our Mailing List

* indicates required fields

Pulling your hair out over your website?

Contact us today to get a professional website at a great price.

Contact Us Today

Post A Comment