![]() |
![]() |
![]() ![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 333 Pomógł: 0 Dołączył: 4.03.2004 Ostrzeżenie: (0%) ![]() ![]() |
witam
mam taki problem do obcięcia tekstu używałem funkcji substr(), czyli tak
ale teraz pojawił się problem bo gdy w tekscie będzie jakiś tag htmlu (np. <a href=cośtam.php target=blank cass=s>) to utnie mi go też :/ wie ktoś może jak wyjść z takiej sytuacji ![]() pozdrawiam |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 562 Pomógł: 15 Dołączył: 8.08.2003 Skąd: Denmark/Odense Ostrzeżenie: (0%) ![]() ![]() |
Cytat(http://php.net/substr) Here's a little bit of code to chop strings (with html tags) around a specified length while making sure no html tags are chopped. It also prevents chopping while a tag is still open.
Note: this will only work in xhtml strict/transitional due to the checking of "/>" tags and the requirement of quotations in every value of a tag. It's also only been tested with the presence of br, img, and a tags, but it should work with the presence of any tag.
-------------------- Prank - for the fun. Mac - for the simplicity. Deviantart - for the kick.
Life is ours, We live it our way -- Metallica |
|
|
![]() ![]() |
![]() |
Aktualny czas: 21.08.2025 - 03:37 |