Re: splitting value of string

From: Date: Tue, 08 Aug 2000 04:10:06 +0000
Subject: Re: splitting value of string
Groups: php.general 
Request: Send a blank email to php-general+get-10581@lists.php.net to get a copy of this message
Ok. Thanks. I will just make fields for first name and last. Just to be safe. ---------- >From: Matt McClanahan <cardinal@dodds.net> >To: Mike Tuller <mitull01@willy.wsc.edu> >Cc: php-general@lists.php.net >Subject: Re: [PHP] splitting value of string >Date: Mon, Aug 7, 2000, 11:03 PM > > On Mon, 7 Aug 2000, Mike Tuller wrote: > >> Hi, >> I currently have an email form that asks for the full name of the person >> submitting the email, and on the page that I have set to come up after >> submission, I would like to make more personal. >> >> Example: Thank you, $name for your email. I will get back to you as soon as >> possible. >> >> I would like to extract the first name from the full name field. How is this >> done? Could someone point me to an example? > > Assuming you're expecting a fullname of the format <FirstName> <LastName> > (That is, a first name, a space, and a last name), then you could > $arr = explode(' ',$fullname); and $arr[0] would be the first name. This > is, however, hardly foolproof. > > Matt > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#10581) next »