Posted by Martie on 10/10/80 11:50
On 13 Jun 2006 04:11:56 -0700, lorento wrote...
>
>Try use explode function:
>
>$var1 = "John A. Smith";
>$var1 = explode (" ", $var1);
>$var2 = $var1[0];
>
I prefer to use that function too! Puts everything in a nice tidy ordered array
and can always put the information together however you want.
Martie
--
Newsguy Bandwidth Blowout May-24-2006
Unlimited downloads all day long
http://newsguy.com/nolimits.htm
>
>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]
|