You are here: Re: Cutting strings short with php « PHP Language « IT news, forums, messages
Re: Cutting strings short with php

Posted by Tony on 07/20/05 20:01

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.

--
Tony Garcia
Web Right! Development
Riverside, CA
www.WebRightDevelopment.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация