Re: [PHP] Split/Group date together.

2013-07-18 Thread Bastien Koert
Normally, what I do here is handle that in the loop to display the records ... so start by adding an order by clause to keep the dates together SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato = '18/7/2013' order by dato $prior_date = ; $sHTML = table; while($rows =

Re: [PHP] Split/Group date together.

2013-07-18 Thread Larry Garfield
If I understand you correctly, I call what you're trying to do PHP group by, and did a write up on it a few years back: http://www.garfieldtech.com/blog/php-group-by-with-arrays --Larry Garfield On 7/18/13 8:43 AM, Karl-Arne Gjersøyen wrote: Hello again. In my program I have this: mysql

Re: [PHP] Split

2011-12-13 Thread Daniel Brown
On Tue, Dec 13, 2011 at 15:33, Jack jacklistm...@gmail.com wrote: OK so I have seen enough errors about split, so I decided to update my code:  return split(/, $sPath, $iMax); I tried: return preg_split(/, $sPath, $iMax); return preg_split(/, $sPath, $iMax, PREG_SPLIT_DELIM_CAPTURE);

Re: [PHP] Split

2011-12-13 Thread Dajka Tamás
Hi, First, read the help of 'preg_replace' at php.net. Second: try this: preg_split('/\//',$sPath,$iMax) Third: use explode: explode('/',) Cheers, Tamas 2011.12.13. dátummal, 21:33 időpontban Jack jacklistm...@gmail.com írta: OK so I have seen enough errors about split, so I

Re: [PHP] Split up Date Range

2009-07-01 Thread Ashley Sheridan
On Wednesday 01 July 2009 16:25:29 Matt Neimeyer wrote: I haven't been able to find anything by googling... Does anyone know of any libraries that will split up date ranges? We've got a project where Date Of Attendance is moving from a single type in character field to an automatically built

Re: [PHP] Split up Date Range

2009-07-01 Thread Adam Shannon
It would be easier to standardize the input so you only have to run one regular expression check to validate and then split the data up. On Wed, Jul 1, 2009 at 10:33 AM, Ashley Sheridan a...@ashleysheridan.co.ukwrote: On Wednesday 01 July 2009 16:25:29 Matt Neimeyer wrote: I haven't been able

Re: [PHP] split in to multiple pages ( pagination)

2007-09-18 Thread Joker7
In news: [EMAIL PROTECTED] - Greg Donald wrote : On Sat, 15 Sep 2007, Joker7 wrote: I'm using the code below to display news articles-which works great apart from. I can control the number of articles,but I would like to add a link to the bottom of the page to the un-displayed articles (

Re: [PHP] split in to multiple pages (I think)

2007-09-15 Thread Greg Donald
On Sat, 15 Sep 2007, Joker7 wrote: I'm using the code below to display news articles-which works great apart from. I can control the number of articles,but I would like to add a link to the bottom of the page to the un-displayed articles ( nexted 5 articles and so on) any pointers would be

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

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 or explode quoted strings

2005-11-14 Thread Chris Shiflett
Ördögh László wrote: I would like to split or explode strings in a way that quoted strings inside the strings should remain. e.g.: first second \third third\ fourth \fifth fifth fifth\ after the split I need: first second third third fourth fifth fifth fifth I love explode(), too, but this

Re: [PHP] split or explode quoted strings

2005-11-14 Thread Robin Vickery
On 11/14/05, Ördögh László [EMAIL PROTECTED] wrote: Hello, I would like to split or explode strings in a way that quoted strings inside the strings should remain. e.g.: first second \third third\ fourth \fifth fifth fifth\ after the split I need: first second third third fourth

Re: [PHP] split line of text

2005-09-27 Thread Philip Hallstrom
if chunk_split function split the line of text (here on 50 char) I was wondering if there exists one function who take care if the 50 char is in the middle of the word and split the line first empty space before the word or just after? $newstring = chunk_split($row[1], 50, 'br /'); echo

Re: [PHP] split line of text

2005-09-27 Thread Adi Zebic
Le 27-sept.-05 à 23:52, Philip Hallstrom a écrit : http://us3.php.net/manual/en/function.wordwrap.php thanks a lot! $newtext = wordwrap($row[1], 50, br /\n); echo $newtext; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] split()?

2005-06-14 Thread Mark Cain
Here is one way to do it: $rr=thisscritjajsj[ OUT1 ]ajdamsda;sjo;tkpdk[ OUT2 ]sdfmjs[ OUT3 ]dfjlsd; preg_match(/.*\[(.*)\].*\[(.*)\].*\[(.*)\].*/, $rr, $match); list($whole_match[],$a[],$a[],$a[]) = $match; print pre; print_r ($a); print /pre; exit; Mark Cain - Original Message -

Re: [PHP] split()?

2005-06-14 Thread Matthew Weier O'Phinney
* Mark Cain [EMAIL PROTECTED] : Here is one way to do it: $rr=thisscritjajsj[ OUT1 ]ajdamsda;sjo;tkpdk[ OUT2 ]sdfmjs[ OUT3 ]dfjlsd; preg_match(/.*\[(.*)\].*\[(.*)\].*\[(.*)\].*/, $rr, $match); list($whole_match[],$a[],$a[],$a[]) = $match; This is fine as long as there's precisely three

Re: [PHP] Split command problem

2005-04-11 Thread Jason Wong
On Monday 11 April 2005 09:27, Russ wrote: I have been trying to get the following code working. I keep getting an error on line nine. And the error is? It looks simular to the example in the PHP online manual. If I substitute a print command for line nine I get the correct information

Re: [PHP] Split command problem

2005-04-11 Thread Prathaban Mookiah
I guess you are trying to create an array by the name 'name' and assign two elements to it by calling name($fname, $lname). Am I correct? I think it does not work that way. Try list($fname, $lname) = .. Then the variable $fname and $lname will contain the first and last names. list($fname,

Re: [PHP] Split command problem

2005-04-10 Thread Greg Donald
On Apr 10, 2005 8:27 PM, Russ [EMAIL PROTECTED] wrote: I have been trying to get the following code working. I keep getting an error on line nine. It looks simular to the example in the PHP online manual. If I substitute a print command for line nine I get the correct information from

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Chris Boget
I've been RTFMing for about an hour and I can't find a string function to split haystack 'onebrtwobrthreebrfourbrfive' at the nth occurrence of needle 'br'. strpos gives me the position of the first needle, and strrpos gives me the position of the last needle. But I'm looking for the

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Brian Dunning
? $string = 'onebrtwobrthreebrfourbrfive'; $nthPos = 4; $tmpArr = explode( 'br', $string ); $nthString = $tmpArr[($nthPos - 1)]; ? Thanks Chris, that works great, but it's not doing what I want. I'm just trying to get the position of the 3rd occurrence (for example) of 'br'. So I'm

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Silvio Porcellana
Hi if you want the *rest of the string from the nth br*, I think 'preg_match_all' with PREG_OFFSET_CAPTURE can help you (see http://www.php.net/manual/en/function.preg-match-all.php) You could do something like: code $string = onebrtwobrthreebrfourbrfive; $count = preg_match_all('/br([^]+)/',

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Robert Cummings
On Wed, 2004-09-22 at 12:31, Brian Dunning wrote: ? $string = 'onebrtwobrthreebrfourbrfive'; $nthPos = 4; $tmpArr = explode( 'br', $string ); $nthString = $tmpArr[($nthPos - 1)]; ? Thanks Chris, that works great, but it's not doing what I want. I'm just trying to get the

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Janet Valade
Brian Dunning wrote: Thanks Chris, that works great, but it's not doing what I want. I'm just trying to get the position of the 3rd occurrence (for example) of 'br'. So I'm looking for a function that will return the value 19, given the above example string. From your first post, you just want

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Brian Dunning
I don't understand why explode won't work for you. The explode solution is working. Thanks very much to everyone who replied with so much great information! - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Curt Zirzow
* Thus wrote Janet Valade: Brian Dunning wrote: Thanks Chris, that works great, but it's not doing what I want. I'm just trying to get the position of the 3rd occurrence (for example) of 'br'. So I'm looking for a function that will return the value 19, given the above example string.

Re: [PHP] Split haystack at nth occurrence of needle?

2004-09-22 Thread Curt Zirzow
* Thus wrote Curt Zirzow: $shortString = implode('br', explode('br', $string, $nth)); ignore this. Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] split behaviour differences in perl and php

2004-09-16 Thread Burhan Khalid
Sandip Bhattacharya wrote: This stumped me badly in my present project. Is this a bug or a feature in PHP? I am trying to split a string into two, where only one half (and the delimiter) is present. [ trim ] IN PHP === [EMAIL PROTECTED] ~]$ cat s1.php ?php print

Re: [PHP] split behaviour differences in perl and php

2004-09-16 Thread Curt Zirzow
* Thus wrote Sandip Bhattacharya: This stumped me badly in my present project. Is this a bug or a feature in PHP? I am trying to split a string into two, where only one half (and the delimiter) is present. IN PERL == [EMAIL PROTECTED] ~]$ cat s1.pl @t =

RE: [PHP] split behaviour differences in perl and php

2004-09-16 Thread Andrew Martinez
its own language. Cheers, Andrew Martinez RubyBay Inc. -Original Message- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Thursday, September 16, 2004 10:45 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] split behaviour differences in perl and php * Thus wrote Sandip Bhattacharya

Re: [PHP] split behaviour differences in perl and php

2004-09-16 Thread Matthew Sims
* Thus wrote Sandip Bhattacharya: This stumped me badly in my present project. Is this a bug or a feature in PHP? I am trying to split a string into two, where only one half (and the delimiter) is present. IN PERL == [EMAIL PROTECTED] ~]$ cat s1.pl @t

Re: [PHP] Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 11:03, John Taylor-Johnston wrote: Can I while this? Not sure how to go about it? $pizza = piece1 piece2 piece3 piece4 piece5 piece6; $pieces = explode( , $pizza); echo $pieces[0]; // piece1 echo $pieces[1]; // piece2 Try while(each($pieces)) or foreach($pieces as

Re: [PHP] Split()

2004-02-17 Thread Stuart
John Taylor-Johnston wrote: Can I while this? Not sure how to go about it? while ($pieces exist) { echo $pieces[i]; } This will empty the array so you might want to do this on a copy of it depending on whether it will be needed later in the script... while (count($pieces) 0) { echo

Re: [PHP] Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 11:02, Adam Bregenzer wrote: Try while(each($pieces)) or foreach($pieces as $piece) Brain to fingers problem: while($piece = each($pieces)) http://www.php.net/each http://www.php.net/foreach -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General

Re: [PHP] Split()

2004-02-17 Thread Jochem Maas
save a function call: $applePie = array(1,2,3,4,5,6,7,8); while ($pieceOfPie = array_shift($applePie)) { echo $pieceOfPie; // want some pie? } Stuart wrote: John Taylor-Johnston wrote: Can I while this? Not sure how to go about it? while ($pieces exist) { echo $pieces[i]; } This

Re: [PHP] Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 15:22, Jochem Maas wrote: $applePie = array(1,2,3,4,5,6,7,8); while ($pieceOfPie = array_shift($applePie)) { echo $pieceOfPie; // want some pie? } Careful, that will eat your array as well. When the while loop finishes you won't have any pieces of pie left! IE:

Re: [PHP] Split()

2004-02-17 Thread Jochem Maas
Adam Bregenzer wrote: On Tue, 2004-02-17 at 15:22, Jochem Maas wrote: $applePie = array(1,2,3,4,5,6,7,8); while ($pieceOfPie = array_shift($applePie)) { echo $pieceOfPie; // want some pie? } Careful, that will eat your array as well. When the while loop finishes you won't have any

Re: [PHP] Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 22:28, Jochem Maas wrote: that was the idea: you can't have your pie at eat it right? ;-) Heh, I thought you might have done that deliberately. :) seriously thought, John Taylor-Johnston was asking for help on while loops and I thought I'd give him some brainfood (i.e.

Re: [PHP] split()

2003-11-13 Thread Eugene Lee
On Wed, Nov 12, 2003 at 09:48:37PM -0600, erythros wrote: : : trying to use split(). i want to split a paragraph by sentence. so of course : i used split('[.!?]', $data). but then i noticed i use ... or every now : and again at the end of a sentence. i don't know how to do this though...

Re: [PHP] split()

2003-11-13 Thread erythros
thanx for the help. i got it. when i saw what happened when i put the + at the end i found what i needed. split('[.!?] ', $data) this way it only breaks them up if the . or ! or ? is followed by a space. thanx again for the help. Eugene Lee [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: [PHP] split()

2003-11-12 Thread Chris Shiflett
--- erythros [EMAIL PROTECTED] wrote: trying to use split(). i want to split a paragraph by sentence. so of course i used split('[.!?]', $data). but then i noticed i use ... or every now and again at the end of a sentence. Maybe you could explode on a period followed by a space? I

Re: [PHP] split ...

2003-11-04 Thread CPT John W. Holmes
From: Dan Joseph [EMAIL PROTECTED] I'm getting the following error: [Tue Nov 4 10:01:53 2003] [error] PHP Warning: split() [a href='http://www.php.net/function.split'function.split/a]: REG_EMPTY in /usr/local/apache/htdocs-chm/import_data.php on line 26 Here is the code in question:

RE: [PHP] split ...

2003-11-04 Thread Dan Joseph
Hi, Thanks, that worked like a charm. I didn't realize that | was a special character, that's good to know. I also agree with the explode method. Seems quicker. Thanks! -Dan Joseph The | character is a special character in regular expressions, which split() expects. So, you can

RE: [PHP] split

2003-03-27 Thread Don Read
On 27-Mar-2003 Oden Odenius wrote: I have $word = test; And i want to split it like t e s t I want to make a loop.Like $a = 123; //$a is One two threw not hundred... and i want to make for each $a then $b = $a + 2 The output will be. 3 (1+2) 4 (2+2) 5 (3+2) Any example?

Re: [PHP] split

2003-03-27 Thread Philip Olson
This: $word = 'test'; $len = strlen($word); for ($a = 0; $a $len; $a++) { print $word{$a} . \n; } Will print: t e s t Regards, Philip On Thu, 27 Mar 2003, Oden Odenius wrote: I have $word = test; And i want to split it like t e s t I want to make a loop.Like $a = 123; //$a

RE: [PHP] split

2003-03-27 Thread John W. Holmes
I want to make a loop.Like $a = 123; //$a is One two threw not hundred... and i want to make for each $a then $b = $a + 2 The output will be. 3 (1+2) 4 (2+2) 5 (3+2) Any example? $a = 123; $c = ''; $b = strlen($a); for($x=0;$x$b;$x++) { $c .= $a{$x} +2; } echo $c; ---John W.

Re: [PHP] split() - not working in this case

2002-09-08 Thread Bas Jobsen
? function split_addresses($addr) { $ad = array(); $ad = split(,,$addr); return $ad; } $tos=array(); $to = abcd [EMAIL PROTECTED], efgh [EMAIL PROTECTED]; $tos=split_addresses($to); echo $tos[1]; ? echos efgh [EMAIL PROTECTED] ?? Whats the problem? Maybe you output to a browser and don't

Re: [PHP] split() - not working in this case

2002-09-08 Thread Chris Wesley
On Sun, 8 Sep 2002, N. Pari Purna Chand wrote: $to = abcd [EMAIL PROTECTED], efgh [EMAIL PROTECTED] ; Now split() in the following function*** is notworking as needed. ie, I'm getting $tos[0] = abcd; $tos[1] = efgh; split didn't do anything wrong. use your browser's view source to see

Re: [PHP] split() - not working in this case

2002-09-08 Thread N. Pari Purna Chand
PROTECTED] Sent: Sunday, September 08, 2002 2:33 PM Subject: Re: [PHP] split() - not working in this case On Sun, 8 Sep 2002, N. Pari Purna Chand wrote: $to = abcd [EMAIL PROTECTED], efgh [EMAIL PROTECTED] ; Now split() in the following function*** is notworking as needed. ie, I'm

Re: [PHP] Split files

2002-01-24 Thread DL Neil
Making any sense? Year, so I have to do it manually (thought someone could preveting me from reinvent the wheel... ;-) What are you really trying to achieve? I'm trying to split a large binary file (2 GB) into peaces of 700 MB to burn it on a cd. It's a part of a

Re: [PHP] Split files

2002-01-24 Thread bvr
=Hmm, I'm still come at it from the other way around (all due respect to Jason) - but then I don't recall OpSys details, or know if there is a utility/tool for the job in your choice of OpSys. Well unless it's a *really* obscure OS I'm sure there must be some readily available file splitter

Re: [PHP] Split files

2002-01-24 Thread DL Neil
=Hmm, I'm still come at it from the other way around (all due respect to Jason) - but then I don't recall OpSys details, or know if there is a utility/tool for the job in your choice of OpSys. Well unless it's a *really* obscure OS I'm sure there must be some readily available file

Re: [PHP] Split files

2002-01-23 Thread Martin Thoma
Hi and thaks for your answer. ... Making any sense? Year, so I have to do it manually (thought someone could preveting me from reinvent the wheel... ;-) What are you really trying to achieve? I'm trying to split a large binary file (2 GB) into peaces of 700 MB to burn it on a cd. It's a

Re: [PHP] Split files

2002-01-23 Thread Jason Wong
On Thursday 24 January 2002 15:34, Martin Thoma wrote: Hi and thaks for your answer. ... Making any sense? Year, so I have to do it manually (thought someone could preveting me from reinvent the wheel... ;-) What are you really trying to achieve? I'm trying to split a large binary

Re: [PHP] split array in 2 halfs

2001-10-31 Thread Jack Dempsey
Based on what criteria? if you just want to split the array at element 30, you could use array_splice to get the necessary data... - Original Message - From: Daniel Harik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 01, 2001 2:16 AM Subject: [PHP] split array in 2

Re: [PHP] Split array

2001-08-07 Thread Tim
See: http://www.php.net/implode - Tim http://www.phptemplates.org On 07 Aug 2001 14:02:04 +0200, Veniamin Goldin wrote: How do I split array so, that I'll get string variable with , delimeter of each array value ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

RE: [PHP] Split array

2001-08-07 Thread Karl Phillipson
you could use implode http://www.php.net/manual/en/function.implode.php == Karl Phillipson PHP SQL Programmer Saffron Hill Ventures 67 Clerkenwell Road London EC1R 5BL Saffron Hill: 0207 693 8300 Direct Line: 0207 693 8318 -Original Message- From: Veniamin

RE: [PHP] split on whitespace, preserving whitespace...

2001-07-20 Thread Don Read
On 20-Jul-2001 Garth Dahlstrom wrote: Hi all, I'm trying to build a spell checker for a web form. What has got me stumped is being able to do a split so that whitespace and words are stored as seperate elements of the same array. ideally, I'd use some form of preg_split to put: This

RE: [PHP] split on whitespace, preserving whitespace...

2001-07-20 Thread Don Read
On 20-Jul-2001 Garth Dahlstrom wrote: Hi all, I'm trying to build a spell checker for a web form. What has got me stumped is being able to do a split so that whitespace and words are stored as seperate elements of the same array. ideally, I'd use some form of preg_split to put: This

Re: [PHP] split on whitespace, preserving whitespace...

2001-07-20 Thread Alexandr Grinko
http://www.zend.com/zend/spotlight/spellchecking.php - Original Message - From: Don Read [EMAIL PROTECTED] To: Garth Dahlstrom [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, July 20, 2001 11:41 PM Subject: RE: [PHP] split on whitespace, preserving whitespace... On 20-Jul-2001

Re: [PHP] split on whitespace, preserving whitespace...

2001-07-20 Thread Garth Dahlstrom
Yup, I hear that... I'm going to use something like the following to do my pspell application... pre ?PHP $text = This contans (brackets) {white} shaz-zam this_under space; .; $matches = preg_split(/([\.\;\:\!\{\}\(\)\s]+)/,$text,-1, PREG_SPLIT_DELIM_CAPTURE); echo pre[$text]br[.

Re: [PHP] split() function

2001-07-04 Thread David A Dickson
Thanks for replying ReDucTor but that didn't work either. I tried $line = explode([(|//)], $field); and $line = explode([(|)], $field); and $line = explode([(|\/\/)], $field); with no success. Any other ideas? On Thu, 5 Jul 2001 04:50:29 ReDucTor wrote: $line = explode([(|//)],$field);

Re: [PHP] split() function

2001-07-04 Thread David A Dickson
Thanks that helped, this is what I used: if (ereg(, $field)) $line = explode(, $field); else $line = explode(//, $field); On Thu, 5 Jul 2001 05:29:11 ReDucTor wrote: ?php $line2 = explode(, $field); for($i = 0; $i sizeof($line2); $i++){ if($line2[$i] == ) $useand = 1; else

Re: [PHP] split() function

2001-07-04 Thread Steve Edberg
You don't need a character class here (signified by [] brackets); you can use $line = split('|//', $field); As you can see, this is identical to ReDucTor's solution, except that the brackets are omitted. Character classes only work for single characters, not multiple character strings

RE: [PHP] split string

2001-05-11 Thread Taylor, Stewart
$test = 1,2,3; $arrTest = explode(,,$test); foreach($arrTest as $k=$v) { $vname = test.(!$k?:$k); // global for use later global $$vname; $GLOBALS[$vname] = $v; } // now global $test, $test1, $test2 exist etc -Original Message- From: Jacky [mailto:[EMAIL PROTECTED]] Sent:

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

Re: [PHP] split and array logic

2001-05-01 Thread Gyozo Papp
I can't quite get the logic to create my own associative arrays: if: $stuff[0]=165.33.114.63 anonymous Mozilla/4.0 $stuff[1]=213.35.354.93 anonymous Mozilla/4.0 how do I end up with: $stuff[0][user]=165.33.114.63 $stuff[0][browser]=Mozilla/4.0 $stuff[1][user]=213.35.354.93

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 not

Re: [PHP] split string value again

2001-03-29 Thread dempsejn
"try again" after 20 minutes...give people some time to respond!...anyways, you can explode the variable... list($junk,$domain) = explode("@",$email); checkout http://www.php.net/explode you'll use it a lot -jack - Original Message - From: "Jacky" [EMAIL PROTECTED] Date:

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: [EMAIL PROTECTED] Subject: [PHP] split string

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