You are here: Re: what function will split text « PHP Programming Language « IT news, forums, messages
Re: what function will split text

Posted by Klaus Brune on 10/06/06 21:42

In article <efmieh$1fj2$1@news.mtu.ru>, ashok@replyhere.com says...
> Hi,
> I need a function that will divide text from mysql in 2 parts, so that I
> can display first half in one column and second half in second column.
> I can't find what function will do this job.

It may or may not be overkill, depending on the complexity of the
delimiter and your split, but my first thought went to using preg_match
and assigning the $matches array. Then use sub-expressions (parenthesis)
to extract the parts you need. I use this all the time to, say, batch-
convert a a bunch of web pages for inclusion in a database, with header
field like metatag keywords and description extracted nicely.

Just give a shout here if you'd like to see some sample code, and I'll
see if I can hunt it down.

Later
GC

 

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

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