Hi.
I've got this function
function stringTransform($str,$len) {
if(strlen($str)>$len){
preg_match("/^(?=(.{{$len},}?b))/s",$str,$chunked);
$str= $chunked[1].'...';
}
return $str;
}
$testo = "<p>Opera powers the Web on any device.Surfe the full Web and create dynamic applications using Web technology with Opera 9 for Devices</p>";
echo stringTransform($testo,50);
I'd like to get somthing like this :o
<p>Opera powers the Web on any device.Surfe the full...</p>
Possible strings:
"<p>Opera powers the </p>"
"Opera powers the "
"<p>Opera <a href="url">here</a> powers the </p>"
Could you help me, please ?
I'm not know which way to turn 😃
Thanks in advance.
Bye.