{php}

{php}

{php} tags allow php to be embedded directly into the template. They will not be escaped, regardless of the $php_handling setting. This is for advanced users only, not normally needed.

Example 7-17. {php} tags

{php}
   // including a php script directly
   // from the template.
   include('/path/to/display_weather.php');
{/php}

Technical Note: To access PHP variables in {php} blocks you may need to use the PHP global keyword.

Example 7-18. {php} tags with global

{php}
   global $foo, $bar;
   if($foo == $bar){
     // do something
   }
{/php}

See also $php_handling, {include_php}, {include} and Componentized Templates.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.