Re: PHP Concatenate
- From: Luuk <luuk@xxxxxxxxxxx>
- Date: Mon, 21 May 2012 21:19:37 +0200
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
.
- Follow-Ups:
- Re: PHP Concatenate
- From: Jerry Stuckle
- Re: PHP Concatenate
- References:
- PHP Concatenate
- From: Kevin Davis
- PHP Concatenate
- Prev by Date: Re: array filtering question
- Next by Date: Re: PHP Concatenate
- Previous by thread: Re: PHP Concatenate
- Next by thread: Re: PHP Concatenate
- Index(es):