Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin3!goblin.stu.neva.ru!news.cgarbs.de!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Message-ID: <4FBA9549.7090409@invalid.lan> Date: Mon, 21 May 2012 21:19:37 +0200 From: Luuk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 Newsgroups: comp.lang.php To: Kevin Davis Subject: Re: PHP Concatenate References: <9ee80c71-db8e-4adf-8f59-03d2749fbe5b@googlegroups.com> In-Reply-To: <9ee80c71-db8e-4adf-8f59-03d2749fbe5b@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Lines: 16 NNTP-Posting-Host: 2001:980:9089:1:d1e1:c47d:e430:4ef3 X-Trace: 1337628002 news.xs4all.nl 6855 [2001:980:9089:1:d1e1:c47d:e430:4ef3]:55703 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.php:6113 On 21-05-2012 20:47, Kevin Davis wrote: > Hi there, > > Here is what I'm trying to do.. I'm trying to merge the first and last name (that I can do) into an email address. But what I'm trying to do is to drop the middle initial. If the entry was from a form, I would have no problem, but the data will be uploaded from a different source, how would I go about dropping the middle initial? > > Would I use regex?? > > Thank you, > Kevin $name="Kevin R. Davis"; $a=split(" ",$name); print $a[0]." ".$a[count($a)-1]; It should print: Kevin Davis