Mikijs Posted June 10, 2008 Report Share 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; Link to comment Share on other sites More sharing options...
andrisp Posted June 10, 2008 Report Share Posted June 10, 2008 (edited) php.net/mb_strlen Tu "aprauj" tekstu ar <marque> taga palīdzību ? Edited June 10, 2008 by andrisp Link to comment Share on other sites More sharing options...
Mikijs Posted June 10, 2008 Author Report Share 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.. Link to comment Share on other sites More sharing options...
andrisp Posted June 10, 2008 Report Share Posted June 10, 2008 Es jau nemaz neteicu neko par wordwrap. Es tikai brīnos par to marque. Link to comment Share on other sites More sharing options...
Mikijs Posted June 10, 2008 Author Report Share 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.. Link to comment Share on other sites More sharing options...
777 Posted June 10, 2008 Report Share 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 Link to comment Share on other sites More sharing options...
Paulinjsh Posted June 10, 2008 Report Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts