Solved

splitting the string PHP

Posted on 2007-04-11
2
153 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 250 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Simple PHP/mySQL Query 3 51
Please show me easiest post form. 3 31
Should I use subdomains or addon domains? 3 35
Session timeout 5 14
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now