PHP Tutorials – Basic PHP Syntax

Basic PHP Syntax

[xyz-ihs snippet=”Google-Adsense”]

Basic PHP Syntax – The basic PHP syntax is <?php (all code goes here) ?>. You may also consider the second basic PHP syntax as <? (all code goes here ?>, which is without the word “php”.

[xyz-ihs snippet=”200-x-90″]

Example Program of Basic PHP Syntax:

  print "Basic PHP Syntax tutorial by";

[xyz-ihs snippet=”200-x-90″]

Instead of print, you can also use echo, which is in fact mostly used for printing. Such as:

  echo "Learn programming with";

But remember, the file must be saved as .php. You may use html code inside a php extension file, but you can’t use PHP code inside html extension file. So it’s always good to choose .php, even if you’re going to use only the html, as you may need PHP edition in the file in future.

[xyz-ihs snippet=”200-x-90″]

“My posts/articles/images are not allowed to be stolen/copied anywhere at Cyber space. Doing so will allow me to take a legal action against the copier.”

[xyz-ihs snippet=”200-x-90″]

Related Posts

Leave a Comment

Kindly solve the following puzzle to prove that you\'re not a bot: