?
Solved

splitting the string PHP

Posted on 2007-04-11
2
Medium Priority
?
158 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

770 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