parsePHP

Navigation:  Development > Function Reference > Helpers > Utility >

parsePHP

Previous pageReturn to chapter overviewNext page

Execute PHP code from a string.

 

App::Utility()->parsePHP(String, Option)

 

Parameter

Description

String

String value with PHP code

Options

Pass variable in string

 

 

See bellow example:
 

$data = 'Say some greeting<br />
{php} echo "Hello, Mr. $name"; {/php}<br />
<?php echo "Hi, $name"; ?>';   
   
$str = App::Utility()->parsePHP($dataarray('name'=>'Junal));
echo($str);
 
/* Output
Say some greeting<br />
Hello, Mr. Junal Rahman<br />
Hi, Junal Rahman
*/