Solved

splitting the string PHP

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to dynamically set the form action using jQuery.
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.

743 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

12 Experts available now in Live!

Get 1:1 Help Now