![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 128 Pomógł: 0 Dołączył: 3.11.2014 Ostrzeżenie: (0%) ![]() ![]() |
Cześć, mam system newsow i automatyccznie dadaje newsa, ale jednak chcialbym, aby tekst był uciety. Dajmy na to do 150 znakow, a nastepnie na dole pojawia się Czytaj Więcej i przekierowywuje mnie na strone z pelnym artykulem, jak to zrobic ?
http://signweb.xaa.pl/skrypt/news.php |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 128 Pomógł: 0 Dołączył: 3.11.2014 Ostrzeżenie: (0%) ![]() ![]() |
// strip tags to avoid breaking any html
$string = strip_tags($string); if (strlen($string) > 500) { // truncate string $stringCut = substr($string, 0, 500); // make sure it ends in a word so assassinate doesn't become ass... $string = substr($stringCut, 0, strrpos($stringCut, ' ')).'... <a href="/this/story">Read More</a>'; } echo $string; to w plik, ktory news wyswietla? |
|
|
![]() ![]() |
![]() |
Aktualny czas: 17.10.2025 - 13:01 |