Reply to Re: PHP RegEx

Your name:

Reply:


Posted by lorento on 06/13/06 11:11

Try use explode function:

$var1 = "John A. Smith";
$var1 = explode (" ", $var1);
$var2 = $var1[0];

--
http://blog.deshot.com
http://www.groupvita.com


moxie19@gmail.com wrote:
> Hello,
>
> It's my first post, hopefully I can get some help here.
>
> I have a string like: $var1 = "John A. Smith"
> What I am looking to do is extract the first name out of the entire
> string into a new variable, so it would be something like this: $var2 =
> "John"
>
> Anybody know an easy way to accomplish this?
>
> Thanks in advance

[Back to original 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

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