We can load PHP code based block content into a variable */
$phpContent = '
<?php
$sampleString = "my sample content!";
echo "Length of <i>" . $sampleString . "</i> is : " . strlen($sampleString);
?>';
/* PHP code is processed and giving output */
echo drupal_eval($phpContent);
Output:
Length of my sample content! is : 18
No comments:
Post a Comment