Solved

splitting the string PHP

Posted on 2007-04-11
2
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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 look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

733 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