PHP Tutorials for beginners – 2

Hi Guys, Hope you guys have successfully installed xampp server or wamp server in your computer. That's is fine, Still If you have confusion go back to our previous tutorial or put your queries

in comments section, I will try to update you. As I told you earlier PHP is a server-side scripting language designed for web development. It is influenced by C, C++, Perl and Java. For this PHP implementation you must know basic programming about C language coding. If you are good in C or Java, Which is very easy to implement. PHP commands can be embedded directly into an HTML source document rather than calling an external file to process data. You can make a full php code to output. Like that way we are going to develop.

PHP codes must start with <? and ends with ?>. In between these we should put our code.

OK let us start our first php program here. Open any editor like notepad, notepad++, intype etc. which is your favorite in your system, do write following eg codes.

Eg 1:

Assume we should display Hi everyone, This is a beautiful world with beautiful people. we are going to display this sentence through PHP.
<?php              
    echo "Hi everyone, This is a beautiful world with beautiful people";
?>

How to save files:

If you are using Xampp,

save this file under C:\xampp\htdocs\*  (Check where Xampp is installed. Inside that you can get the htdocs).

saving file name extension should ends with .php (For eg, test.php).

If you are using Wamp,

save this file under C:\wamp\www\*    (Check where Wamp is installed. Inside that you can get the www).
eg 2:
<?php
echo "I am a PHP programmer.";
echo "<br />";                                                           // This is HTML tag, We can use it in PHP.
echo "I am a web developer. ";
?>

Notes about our above code:

// means commenting our quotes for our reference inside the PHP syntax. This sentences will now be showing in the output.

<?php - This is what php code must start.

?> - This is what php code must end.

for displaying anything in the output should use echo function.

Thanks for reading, Post your comments. See you at next post.

Post a Comment

Post a Comment (0)

Previous Post Next Post