You are here: Re: preg_match quastion « PHP Programming Language « IT news, forums, messages
Re: preg_match quastion

Posted by d on 03/06/06 12:44

<kirill_uk@hotmail.com> wrote in message
news:1141612600.759943.298690@e56g2000cwe.googlegroups.com...
> Hi All, wondering if someone could help me with this.
> I have a variable $var="blh blh blah bldd erter etert";
> i need to get first three words from it so basically i have to
> ,somehow, count first three spaces and get "blh blh blah" to a new var.
> Any idea?
> Thank you all!

$first_three=join(" ", array_slice(explode(" ", $var), 0, 3));

if you want to do it without preg_match :)

 

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

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