PHP Syntax and Tags | The Dev Tool | Toolel.com

Default Syntax

The default syntax starts with "<? php" and ends with "?>".

Example:

<?php
echo "Default Syntax";
?>

Short open Tags

The short tags starts with "<?" and ends with "?>". Short style tags are only available when they are enabled in php.ini configuration file on servers.

Example:

<?
echo "PHP example with short-tags";
?>

Omit the PHP closing tag at the end of the file

It is recommended that a closing PHP tag shall be omitted in a file containing only PHP code so that occurrences of accidental whitespace or new lines being added after the PHP closing tag, which may start output buffering causing uncalled for effects can be avoided.

Example:

<?php
echo "PHP example with short-tags";

Created by: Altin

Comments

This page is only partially working without JavaScript. It will show content, but the tools and interactivity cannot be shown without JavaScript enabled. Please enable JavaScript for this page. About Us