function cut($tekst,$ile){
$tekst = strip_tags($tekst);
if (strlen($tekst) > $ile) {
$tekst=substr($tekst, 0, $ile);
for ($a=strlen($tekst)-1;$a>=0;$a--) {
if ($tekst[$a]==" ") {
$tekst=substr($tekst, 0, $a)."...";
break;
};
};
};
return $tekst;
}
$tekst = $value['shorttext'];
echo'<p class="posttext">'; echo cut($tekst, 60); echo'</p>';
Co zrobić by do zmiennej $tekst można było przypisać więcej rekordów?