[PHP] Split string

2007-05-02 Thread Lester Caine
Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one string, and the rest of the string into a second. It's the 'first either space or comma' that

Re: [PHP] Split string

2007-05-02 Thread Fredrik Thunberg
Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one string, and the rest of the string into a second. It's the 'first either

Re: [PHP] Split string

2007-05-02 Thread Lester Caine
Fredrik Thunberg wrote: Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one string, and the rest of the string into a second.

Re: [PHP] Split string

2007-05-02 Thread Stut
Fredrik Thunberg wrote: Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one string, and the rest of the string into a second.

Re: [PHP] Split string

2007-05-02 Thread Stut
Stut wrote: Alternatively you could use split to break the string into the two parts, which is probably more efficient... list($part1, $part2) = split('[ ,]', $myString); Oops, this should have a third parameter... list($part1, $part2) = split('[ ,]', $myString, 2); -Stut -- PHP General

Re: [PHP] Split string

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 3:55 am, Lester Caine wrote: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one string, and the rest of the string into a

Re: [PHP] Split string

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 4:55 am, Lester Caine wrote: Fredrik Thunberg wrote: Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one

Re: [PHP] Split string

2007-05-02 Thread Stut
Richard Lynch wrote: On Wed, May 2, 2007 4:55 am, Lester Caine wrote: Fredrik Thunberg wrote: Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space

Re: [PHP] Split string

2007-05-02 Thread Jim Lucas
Stut wrote: Richard Lynch wrote: On Wed, May 2, 2007 4:55 am, Lester Caine wrote: Fredrik Thunberg wrote: Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to

Re: [PHP] Split string

2007-05-02 Thread Edward Vermillion
On May 2, 2007, at 4:10 PM, Stut wrote: Richard Lynch wrote: On Wed, May 2, 2007 4:55 am, Lester Caine wrote: Fredrik Thunberg wrote: Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I

Re: [PHP] Split string

2007-05-02 Thread Richard Lynch
On Wed, May 2, 2007 4:10 pm, Stut wrote: Richard Lynch wrote: On Wed, May 2, 2007 4:55 am, Lester Caine wrote: Fredrik Thunberg wrote: Lester Caine skrev: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I

Re: [PHP] Split string

2007-05-02 Thread Lester Caine
Jim Lucas wrote: Can someone with a few more working grey cells prompt me with the correct command to split a string. The entered data is names, but I need to split the text up to the first space or comma into one string, and the rest of the string into a second. It's the 'first either space

[PHP] ? Split string into smaller chunks

2005-12-19 Thread Labunski
I need to split a long string into smaler chunks (an array), as a separator using every third \n (and not just every \n). I could use 'explode', but then it would produce too many chunks. Thank you in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] ? Split string into smaller chunks

2005-12-19 Thread Jay Blanchard
[snip] I need to split a long string into smaler chunks (an array), as a separator using every third \n (and not just every \n). I could use 'explode', but then it would produce too many chunks. [/snip] http://us2.php.net/manual/en/function.chunk-split.php -- PHP General Mailing List

Re: [PHP] ? Split string into smaller chunks

2005-12-19 Thread Anas Mughal
Split them using explode and then combine the ones you need to combined. Hope this helps. -- Anas Mughal On 12/19/05, Labunski [EMAIL PROTECTED] wrote: I need to split a long string into smaler chunks (an array), as a separator using every third \n (and not just every \n). I could use

Re: [PHP] ? Split string into smaller chunks

2005-12-19 Thread David Grant
Labunski wrote: I need to split a long string into smaler chunks (an array), as a separator using every third \n (and not just every \n). I could use 'explode', but then it would produce too many chunks. php.net/preg_split Cheers, David -- David Grant http://www.grant.org.uk/ -- PHP

RE: [PHP] split string

2001-05-11 Thread Taylor, Stewart
: 11 May 2001 16:24 To: [EMAIL PROTECTED] Subject: [PHP] split string I got series of string value like this 1,2,3. And the seires are dynamaic, which means it is not always 1,2,3 but could be more, but always in this format that is separated by , . How do I pick each of value in the series

Re: [PHP] split string

2001-05-11 Thread Jason Stechschulte
On Fri, May 11, 2001 at 10:24:02AM -0500, Jacky wrote: I got series of string value like this 1,2,3. And the seires are dynamic dynamaic, which means it is not always 1,2,3 but could be more, but always in this format that is separated by , . How do I pick each of value in the series and

Re: [PHP] split string

2001-05-10 Thread Jack Dempsey
http://www.php.net/manual/en/function.explode.php explode on the comma... you could use while loop and variable variables to take care of the naming... -jack Jacky wrote: I got series of string value like this 1,2,3. And the seires are dynamaic, which means it is not always 1,2,3 but

[PHP] split string value

2001-03-29 Thread Jacky
Hi people If I have value like [EMAIL PROTECTED] stored in a variable. How do I break it up to be take only the foo.com bit to use that to redirect user back to that URL? Jack [EMAIL PROTECTED] "There is nothing more rewarding than reaching the goal you set for yourself"

[PHP] split string value again

2001-03-29 Thread Jacky
Hi again have to try again after I have not recieved any advice, I have a vairable that stores email address value. I need to break it so that I will only get the dmain name bit to store in another variable so that I can redirect user to that domain, like if user email is [EMAIL PROTECTED]

Re: [PHP] split string value

2001-03-29 Thread Yasuo Ohgaki
Use split('@',$email_address) http://www.php.net/manual/en/function.split.php -- Yasuo Ohgaki ""Jacky"" [EMAIL PROTECTED] wrote in message 005a01c0b8a0$453ede00$[EMAIL PROTECTED]">news:005a01c0b8a0$453ede00$[EMAIL PROTECTED]... Hi people If I have value like [EMAIL PROTECTED] stored in a

RE: [PHP] split string value again

2001-03-29 Thread Martin Cabrera Diaubalick
Try to use explode and keep the second element of the array Just a quick thought .. - Original Message - From: Jacky [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 30, 2001 12:52 AM Subject: [PHP] split string value again Hi again have to try again after I have

Re: [PHP] split string value again

2001-03-29 Thread dempsejn
y" [EMAIL PROTECTED] Date: Thursday, March 29, 2001 5:52 pm Subject: [PHP] split string value again Hi again have to try again after I have not recieved any advice, I have a vairable that stores email address value. I need to break it so that I will only get the dmain name bit to store in an

RE: [PHP] split string value again

2001-03-29 Thread Stewart Taylor
$addr = "[EMAIL PROTECTED]"; $splitaddr = explode("@",$addr); resulting in $splitaddr[0] = "test"; $splitaddr[1] = "foo.com"; -Stewart -Original Message- From: Jacky [mailto:[EMAIL PROTECTED]] Sent: 29 March 2001 23:52 To: [EMAI

Re: [PHP] split string value again

2001-03-29 Thread elias
try this snippet: ? if (ereg("[^@]+\$", "[EMAIL PROTECTED]", $result)) { $domain = $result[0]; echo $domain; } ? ""Jacky"" [EMAIL PROTECTED] wrote in message 009301c0b8a2$e856f6c0$[EMAIL PROTECTED]">news:009301c0b8a2$e856f6c0$[EMAIL PROTECTED]... Hi again have to try again after I

Re: [PHP] split string value again

2001-03-29 Thread [EMAIL PROTECTED]
ky' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, March 29, 2001 3:51 AM Subject: RE: [PHP] split string value again $addr = "mailto:[EMAIL PROTECTED]; $splitaddr = explode("@",$addr); resulting in $splitaddr[0] = "test"; $splitaddr[1] = "foo.c

Re: [PHP] split string value again

2001-03-29 Thread Steve Werby
"Jacky" [EMAIL PROTECTED] wrote: I have a vairable that stores email address value. I need to break it so that I will only get the dmain name bit to store in another variable so that I can redirect user to that domain, like if user email is [EMAIL PROTECTED] then I would like to break that