Mikijs Posted June 10, 2008 Report Posted June 10, 2008 Vai ir kada funkcija ar kuru es varetu noteikt teksta garumu piemeram.. ja es velos lai neaprauj tekstu tad piemeram butu $garums=kaut_kada_funkcija($teksts); $limits=150; if($garums>=$limits) echo "<marquee>$teksts</marquee>"; else echo $teksts;
andrisp Posted June 10, 2008 Report Posted June 10, 2008 (edited) php.net/mb_strlen Tu "aprauj" tekstu ar <marque> taga palīdzību ? Edited June 10, 2008 by andrisp
Mikijs Posted June 10, 2008 Author Report Posted June 10, 2008 ne :) es negribu apraut ar wordwrap es gribu ja teksts ir garaks lai nestaipitos lapa <td nowrap> tad lai ir marquee..
andrisp Posted June 10, 2008 Report Posted June 10, 2008 Es jau nemaz neteicu neko par wordwrap. Es tikai brīnos par to marque.
Mikijs Posted June 10, 2008 Author Report Posted June 10, 2008 ne ne viss kartiba :) vnk zin ka lai nebutu velviena lieka linija tad tomer garaku tekstu kur vajg attelot visu to tekstu labak butu paradit ar marquee..
777 Posted June 10, 2008 Report Posted June 10, 2008 (edited) $lenght = strlen($text); if($lenght < "200") { $text = htmlspecialchars($text); $text = substr($text, 0, 200); $text = nl2br($text); } ari pirmo reiz dzirdu lai izmantotu marquee ja teksts ir garaks par ... simboliem. Edited June 10, 2008 by 777
Paulinjsh Posted June 10, 2008 Report Posted June 10, 2008 tā kā strlen nepareizi nosaka utf8 simbolu skaitu, tad lietojam mb_strlen lai noteiktu garumu un mb_substr, lai izgrieztu vajadzīgo stringu.
Recommended Posts