Executing PHP code in Drupal
/* Assigning a PHP code into a variable or
We can load PHP code based block content into a variable */
$phpContent = '
$sampleString = "my sample content!";
echo "Length of <i>" . $sampleString . "</i> is : " . strlen($sampleString);
/* PHP code is processed and giving output */
Length of my sample content! is : 18
Leave a Reply.