You are here: RE: [PHP] Looking for a string function « PHP « IT news, forums, messages
RE: [PHP] Looking for a string function

Posted by Jay Blanchard on 11/02/05 23:45

[snip]
I seem to remember a built in php function that will take a huge block of
text.
Then just spit out X number of characters from it and follow it with an
additional string value.
But I cannot remember what it is.

I seem to remember it being something other than the substr().

I am looking to pull the first say 200 characters from an article and follow
the last character/word with something like ...

Does anyone know what I am talking about, or am I just smoking something and
my memory is going?
[/snip]

Usually folks roll their own as there is no set function for this.

$myShortString = substr($string, 0, 200)."...";

will work, but you're going to cutoff in the middle of some word at the end
of the substring usually.

 

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

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