Basic Code in PHP
If you are well familiar with that and ready to start coding with php, then I have some clean suggestions for you.
Open your IDE for PHP, if you are not having and IDE, don’t worry you can code in Notepad.
Now you have to insert the starting and ending tags of php. Each PHP script starts and end with special opening and closing tags. Commonly used style is below:
You can also code in ASP style, for ASP starting and ending tags are as <% %>. The first thing is that you have to print a string. Write the following code and open it in your browser.
Printing a string
echo ‘My very First Code’; // it will Print out the string you entered
I am writing my code in Adobe Dreamweaver, You can use any of PHP editor.
Save your file as basic.php
Note that you have to save your file in your server folder(WWW or Htdocs). I have created a new folder with name “abc” at my server and saved my file as basic.php in that directory.
Open your browser and write down the address of your directory, in my example, i am on localhost and i have entered the following address:
where abc is the name of my directory and basic.php is the name of my file.
You will have the following output: