PHP Tutorials – Basic PHP Syntax

Basic PHP Syntax

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”.

Example Program of Basic PHP Syntax:

  print "Basic PHP Syntax tutorial by";

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.

“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.”

Related Posts

Leave a Comment

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