Code: Select all
<actinic:block php="true" >
$sShort = "";
$nCount = 0;
$sOriginal = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />';
$newstring = preg_replace('/(\{|{)(.*?)(}|\})/s', '<br>', $sOriginal);
foreach(explode(" ", $newstring) as $sWord)
    {
   if ($nCount > 10)
    {
    $sShort .= "...";
    break;
    }
   $sShort .= $sWord . " ";
   $nCount++;
   }
echo $sShort;
</actinic:block>