$output = 'string based on php grammar';
eval(' ?>' . $output . '<?php ');
$output = ob_get_contents();
ob_end_clean();
//To do sth about $output
$output = 'string based on php grammar';
eval(' ?>' . $output . '<?php ');
$output = ob_get_contents();
ob_end_clean();
//To do sth about $output