You could also use list($address) = explode('#', $innerRow
['PeopEmail']), which does the same thing as array_shift, but without
an extra function call.
No matter what you pick, it'll be either two inbuilt function calls or
a language construct and an inbuilt function call, so you'll probably
need a heck of a lot of iterations before you'll notice one being
marginally faster than another.
As for each one is better, that's totally a matter of taste.
On 14/05/2010, at 10:33 PM, yeosteve wrote:
Hi
I have a field in a database with
[email protected]#mailto:[email protected]# . I want to reduce it
to just the email address.
Is is better/faster to use
substr($innerRow['PeopEmail'],0,strpos($innerRow['PeopEmail'],'#'))
or
array_shift(explode('#',$innerRow['PeopEmail']))
Thanks
Steve
---
Simon Welsh
Admin of http://simon.geek.nz/
Who said Microsoft never created a bug-free program? The blue screen
never, ever crashes!
http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e
--
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]