Need help with extracting the userid part of an email address through string processing functions. For example, I would like to return a string variable with a value of "imnu1234" from imnu1234@yahoo.com.
One way of doing that would be to use explode(), e.g.
$email = "imnu1234@yahoo.com"; $email = explode("@", $email); echo $email[0];
Thanks for the prompt response. I will give it a try.
You are fast as laserlight!
It works (Of course you knew that!). Can you explain what "explode" does? Does it mean splitting the string at @ and assign the string chunks to an array?
take a look
http://www.php.net/manual/function.explode.php
reg kevin
Does it mean splitting the string at @ and assign the string chunks to an array?
well, that is quite logical based on the result, isnt it? 🙂
anyway, take a look at the link kevinsequeira provided for more info
Thanks to both of you. I took a quick look at the function. What I said wasn't too far away, was it?