Jump to content

Only variables can be passed by reference


AdRock

Recommended Posts

function ShortenText($text, $chars) {
$text = $text." ";
$text = substr($text,0,$chars);
$text = substr($text,0,strrpos($text,' '));
$text = $text."...";

return $text;
}

$placeholders = array($keywords, $uckeywords);
$vals = array("<span class='searchbold'>$keywords</span>", "<span class='searchbold'>$uckeywords</span>");
$link = str_replace($placeholders, $vals, $title);
$add = str_replace($placeholders, $vals, $content);
$add = ShortenText(str_replace('&', '&',$add,500);

 

How do i fix the error

Only variables can be passed by reference
?

 

I want to replae the keywords with bold text and also change the ampersands to &

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.