|
Posted by Stefan Rybacki on 07/20/05 22:01
Tony wrote:
> Stefan Rybacki wrote:
>
>>Hello wrote:
>>
>>>There is a function in PHP that strips the HTML tags called
>>>"strip_tags" then when you get the string back with no tags use
>>>"substr" or something to get the first 100 chars.
>>>
>>>
>>
>>How will that help him, since I guess he needs the HTML tags?!
>>
>
>
> I could see that possibly causing some problems, since you would have
> opening tags but no closing tags. Depending on the tags, of course:
>
> <pre>This is a string of more than 100 characters. This is a string of more
> than 100 characters. This is a string of more than 100 characters. This is a
> string of more than 100 characters. This is a string of more than 100
> characters. This is a string of more than 100 characters.</pre>
>
> could cause the rest of the page to not function properly. Seems to me that
> stripping the HTML would be better, if you're not displaying the whole
> string.
>
Thats true, but if you split the string like I proposed you could simply add closing tags
to opened tags after cutting the string.
Regards
Stefan
Navigation:
[Reply to this message]
|