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

2007-09-18 Thread Joker7
In news: [EMAIL PROTECTED] - Thomas Bachmann wrote : Why don't post an example of your news file too? Joker7 schrieb: Hi, 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

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

2007-09-16 Thread Thomas Bachmann
Why don't post an example of your news file too? Joker7 schrieb: Hi, 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

[PHP] Re: Split string

2007-05-03 Thread itoctopus
if ($your_string !== ''){ $arr_string = explode(',', $your_string); $first_part = $arr_string[0]; array_shift($arr_string); $second_part = implode(',', $arr_string); } -- itoctopus - http://www.itoctopus.com Lester Caine [EMAIL PROTECTED] wrote in message news:[EMAIL

[PHP] Re: Split string

2007-05-02 Thread Al
Look at split() and explode(). 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

[PHP] Re: split()?

2005-06-14 Thread Matthew Weier O'Phinney
* [EMAIL PROTECTED] [EMAIL PROTECTED]: How would I do this ? Take this string and return everything between [ ] as an array output doesnt have to inlude [ ] $rr=thisscritjajsj[ OUT1 ]ajdamsda;sjo;tkpdk[ OUT2 ]sdfmjs[ OUT3 ]dfjlsd; $a = some function echo 'pre'; print_r($a); [0] =

[PHP] Re: Split()

2004-02-17 Thread John Taylor-Johnston
I can do this, but want to understand how to while it: Or should I? $tempslices = explode(\r\n, $pizza); foreach ($tempslices as $singleslice) { echo a href=\http://www.foo.org$singleslice\;$singleslice/a ; } Still learning :) John Taylor-Johnston wrote: Can I while this? Not sure

Re: [PHP] Re: Split()

2004-02-17 Thread John W. Holmes
From: John Taylor-Johnston [EMAIL PROTECTED] I can do this, but want to understand how to while it: Or should I? $tempslices = explode(\r\n, $pizza); foreach ($tempslices as $singleslice) { echo a href=\http://www.foo.org$singleslice\;$singleslice/a ; } Still learning :)

Re: [PHP] Re: Split()

2004-02-17 Thread John Taylor-Johnston
John, Thanks. It's a question of understanding it. I can get a foreach to work, but my while doesn't. There's no real reason to use while() over foreach(). Why do you think you need to use while()? Rather than ask people to code for me, I'm trying to spend a little extra time to try and learn

Re: [PHP] Re: Split()

2004-02-17 Thread Adam Bregenzer
On Tue, 2004-02-17 at 13:01, John Taylor-Johnston wrote: $tempauthors = explode(\r\n, $mydata-AuthorList); foreach ($tempauthors as $singleauthor) # while($tempauthors = each($singleauthor)) { echo a href=\http://www.foo.org$singleauthor\;$singleauthor/a ; } First of all, you are

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

2001-07-20 Thread Garth Dahlstrom
try $wordarr = explode( , $string); mmm... yeah... That's what I had before (acutally I was using the alias split)... it does NOT however preserve the areas of white space. Instead the target of: $wordsarr = ('This',' ','contans','','white',' ','space',' ','.') You get: $wordsarr

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

2001-07-20 Thread Stefan Rusterholz
: Garth Dahlstrom [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, July 20, 2001 1:44 PM Subject: [PHP] Re: split on whitespace, preserving whitespace... try $wordarr = explode( , $string); mmm... yeah... That's what I had before (acutally I was using the alias split

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

2001-07-20 Thread Jack Dempsey
: [EMAIL PROTECTED] Subject: [PHP] Re: split on whitespace, preserving whitespace... try $wordarr = explode( , $string); mmm... yeah... That's what I had before (acutally I was using the alias split)... it does NOT however preserve the areas of white space. Instead the target of: $wordsarr

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

2001-07-20 Thread Stefan Rusterholz
: [PHP] Re: split on whitespace, preserving whitespace... If you'r using PHP 4 use preg_split. (works also with php 3 = 3.09) see http://www.php.net/manual/en/function.preg-split.php for detailed information. The split pattern you'd need is: $sometext2split = hello world witha lot

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

2001-07-20 Thread Jack Dempsey
To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: split on whitespace, preserving whitespace... Uuhmm, I'm sorry. I haven't read it throught to the end. The solution ist a bit different: use preg_replace to replace multiple spaces with single spaces: $sometext2split = preg_replace(|, ,$sometext2split); #make

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

2001-07-20 Thread Stefan Rusterholz
And after having read it thorugh I remark, that I'm going to disgrace myself... :-( Just forget my answer, Jack Dempsey is right. Sorry - Original Message - From: Stefan Rusterholz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 20, 2001 3:47 PM Subject: Re: [PHP] Re: split

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

2001-07-20 Thread Garth Dahlstrom
On Fri, 20 Jul 2001 09:32:00 -0400 Jack Dempsey wrote: $text = This contanswhite space .; $matches = preg_split(/(\s+)/,$text,-1, PREG_SPLIT_DELIM_CAPTURE); echo implode('',$matches); Nope that doesn't do it. here's the test: echo pre[$text]br[. implode('',$matches).]/pre; here's

Re: [PHP] Re: split on whitespace, preserving whitespace... (a rephrase of the question)

2001-07-20 Thread Garth Dahlstrom
Rusterholz, [EMAIL PROTECTED] - Original Message - From: Garth Dahlstrom [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, July 20, 2001 1:44 PM Subject: [PHP] Re: split on whitespace, preserving whitespace... try $wordarr = explode( , $string); mmm

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

2001-07-20 Thread Garth Dahlstrom
running php = 4.0.5? jack -Original Message- From: Garth Dahlstrom [mailto:[EMAIL PROTECTED]] Sent: Friday, July 20, 2001 10:06 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Re: split on whitespace, preserving whitespace... On Fri, 20 Jul 2001

Re: [PHP] Re: split on whitespace, preserving whitespace... (a rephrase of the question)

2001-07-20 Thread Stefan Rusterholz
: [PHP] Re: split on whitespace, preserving whitespace... (a rephrase of the question) On Fri, 20 Jul 2001 15:34:48 +0200 Stefan Rusterholz wrote: If you'r using PHP 4 use preg_split. (works also with php 3 = 3.09) see http://www.php.net/manual/en/function.preg-split.php for detailed

Re: [PHP] Re: split on whitespace, preserving whitespace... (a rephrase of the question)

2001-07-20 Thread CC Zona
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Garth Dahlstrom) wrote: $sometext2split = hello world witha lot ofwhitespaces!; $myarray = preg_split (/\s+/,$sometext2split); you should get $myarray := ['hello', 'world', 'with', 'a', 'lot', 'of', 'whitespaces!']

[PHP] RE: split and array logic

2001-05-02 Thread Tim Ward
depends how reliable the format of the string you're splitting is. If they are all like your examples then ... foreach ($stuff as $key=$element) { $dummy = explode( , $element); $stuff[$key] = array(); $stuff[$key][user] = $dummy[0]; $stuff[$key][browser] =