PHP basics

PHP basics

You should always begin a PHP page with <?php and end with ?>
Your php code should go between <?php and end with ?> . You can for example code php , close , then add html code in between as below.
<?php Code ?>
We define a variable in PHP as follow, by the way a variable is anything we use as a shortcut to value.

 = "hello World";
The above example will print hellow World.

We call a variable by echoing or simply including it in php as follow :
echo ; or ;
Don't forget to ; at the end of a variable.

Html code here
<?php rest of php code and end with ?>

Always save a php page in a .php extention. For example, you save example as example.php, otherwise your php code will not work.

Visit websitedevelopmentanddesign.com
for more free web design and development articles

About Author

Established web designer/developer
Visit

websitedevelopmentanddesign.com
for low cost web design and developemtn and free tutorials!

Source: ArticleTrader.com


Other articles in Web Design category

Attracting Web Business

So you’ve finished building a great website and you’re ready to start raking in the profits - if you can figure out how to let the world know your business exists. Although creating an attractive website is an important first step if you plan to start your own online business, it is definitely... More...

Colors in Website Design

=================================================== Since people associate particular colors with different emotions, the colors used on your website can have a psychological effect on visitors to your site. By using specific colors geared towards the emotion you want to invoke, you can... More...

20 pro tips for web designing

The difference between a good web designer and a great one is the ability to know how to take short cuts and save time without compromising the quality of work. Here are 20 top tips and tricks you should be using to give your work that all-important professional edge. 1. Planning: ... More...


web tracker