Hosting Solutions
mobile_logo Table of Contents

PHP Script Tags

There are multiple ways to apply PHP code blocks to documents. Using the standard tag is the recommended approach because it works in all PHP environments regardless of the server settings. standard tag <?php ?> short tag <? ?> Note: PHP short tags can only be used when short_open_tag is enabled in your php.ini configuration file, or if PHP was configured with the --enable-short-tags option. Many developers do not use this approach because of software migration issues that it causes from one server to the next. The standard type tag will work on any server configuration with PHP installed. To allow short tags to work on in your scripts if they do not already by default, you must configure your php.ini script on server. Inside of php.ini you just add this line to enable short php tag usage: short_open_tag = On;



IntroductionPHP Script TagsSyntax GuidelinesCheck PHP InformationData TypesVariablesConstantsUnderstanding Arrays