?
Solved

splitting the string PHP

Posted on 2007-04-11
2
Medium Priority
?
162 Views
Last Modified: 2008-02-07
Hi,


I have a string that is two parts an email address a '+' and a number

me@emailadress.com+23

I want to split it into the two parts and loose the +

$email_address = me@emailadress.com;

$mynumber=23

ta
0
Comment
Question by:roscoeh23
2 Comments
 
LVL 29

Accepted Solution

by:
TeRReF earned 1000 total points
ID: 18887926
$s = 'me@emailadress.com+23';
list($email_address, $mynumber) = explode('+', $s);
echo $email_address.' '.$mynumber;
0
 
LVL 11

Assisted Solution

by:elfe69
elfe69 earned 1000 total points
ID: 18887930
$addr = "me@emailadress.com+23";  
list($email_address, $mynumber) = split('[+]', $addr);
echo 'email: ', $email_address, '<br>';
echo 'number: ', $mynumber, '<br>';
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question