Networking, Programming and Graphics - Tutorials
ONLINEHOWTO.net Tutorials Category

PHP - Step by Step

Type: Code Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Level: Beginner Networking, Programming and Graphics - Tutorials 
Networking, Programming and Graphics - Tutorials
Date: 2006-Dec-20
Networking, Programming and Graphics - Tutorials
Visited: 3625 times
Networking, Programming and Graphics - Tutorials
Rating: Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Published: Ivory Morhuld

PHP is an HTML-embedded scripting language. Much of it's syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly.

PHP. Why is so popular?

The key power of PHP is that this scripting language is very popular in developers and therefore among in hosting service provider.
Mean reason for this is free/open source model for distribution of PHP. The main goal of this is cheap and easy serviceing and developing of internet applications.
Now let's start from the beginning. Declaration.

You already know that the PHP is script language. This mean that the script execute on web server by parsing the code and returning to user static html code. Parsed part must be enclosed with <?php and ?> or <? and ?>

All static html tags are just sended to clients browser like they are on web page. But the PHP part (<?php.....?>) is executed on server and depending on code will output something to browser. In our case this will be nothing because we just have write comment code which do nothing for executing of application.

Please note that in older versions of PHP (<3.0) enclosed tags are <?php and ?> only
<html>
<head>
<title></title>
</head>
<body>
<?php
// Here is PHP code
?>
</body>
</html>
Comments in PHP

Like any other language PHP have code comment capabilities. You can see from code below tags for commenthing the code and how to use them.
<?php
//    With two slashes together you can comment entire row of code to the next new line.

#    This symbol also used for commenting all code on the row

/*
    In this way the part of code
    which is placed between this
    starting and ending symbols
    will be rejected from executing
    on server
*/
?>

PHP : Hello world

Of course first example of our tutorial will be 'hello world' sample code.
<?php
echo "Hello world!";
?>

As you can see, the code above will just output "Hello world!" string.
PHP - Step by Step
Rate this tutorial:                    
Post Comment

    • ( saurin22saurin [ at ] gmail . com ),

      posted on 2009-Aug-10 | 09:48:36 AM
      Hey Please don't mind, but i sow something wrong on ur site. so i m reporting dis.
      check out the url : http://www.onlinehowto.net/Tutorials/PHP/PHP-Step-by-Step/108

      The hello world example contains a bade image.
      see the title bar, it show the path of desktop.
      & as PHP is a server side scripting language u cannot open it directly. if u r using it as web Development it must run through the server like IIS or Apache. cause XP, VIsta Or Windows 7 not understand the extension *.php. we have to configure it with the server. so please change the image that shows server in between
      as like
      http://localhost/temp.php
      thanx

    • posted on 2009-Aug-10 | 11:15:58 AM
      You are totally right! We correct this. Thank you.
    • ( najmulhasan84 [ at ] rediffmail . com ),

      posted on 2010-Jan-30 | 03:50:22 AM
      Sir, Plz Tell Me about PHP Step By Step
    • ( najmulhasan84 [ at ] rediffmail . com ),

      posted on 2010-Jan-30 | 03:51:27 AM
      Dear Sir, Plz Tell me About Php

    • posted on 2010-Jan-30 | 03:52:38 AM
      Here is an article you may find useful:

      http://www.onlinehowto.net/Articles/About-PHP-the-language-for-beginners/63
Need a specific tutorial? Do not hesitate and submit a request!
Your e-mail: