Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread Ashley Sheridan
On Sun, 2012-09-02 at 00:23 -0400, John Taylor-Johnston wrote: > See: > http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php > http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps > > In $mystring, I need to extract everything between "|News Releases|" and > "-30". > > Th

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread Matijn Woudt
On Sun, Sep 2, 2012 at 6:23 AM, John Taylor-Johnston wrote: > See: > http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php > http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps > > In $mystring, I need to extract everything between "|News Releases|" and > "-30". > > The thin

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread Matijn Woudt
On Sun, Sep 2, 2012 at 10:10 AM, Ashley Sheridan wrote: > On Sun, 2012-09-02 at 00:23 -0400, John Taylor-Johnston wrote: > >> See: >> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php >> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps >> >> In $mystring, I need to ex

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread Frank Arensmeier
2 sep 2012 kl. 14.40 skrev Matijn Woudt: > On Sun, Sep 2, 2012 at 6:23 AM, John Taylor-Johnston > wrote: >> See: >> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php >> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps >> >> In $mystring, I need to extract everything

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread John Taylor-Johnston
On Sun, Sep 2, 2012 at 6:23 AM, John Taylor-Johnston wrote: See: http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps In $mystring, I need to extract everything between "|News Releases|" and "-30". The thing now is $

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread John Taylor-Johnston
Frank Arensmeier wrote: >>> See: >>> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php >>> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps >>> >>> In $mystring, I need to extract everything between "|News Releases|" and >>> "-30". >>> >>> My approach would be to sp

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread Matijn Woudt
On Sun, Sep 2, 2012 at 4:36 PM, John Taylor-Johnston wrote: > >> On Sun, Sep 2, 2012 at 6:23 AM, John Taylor-Johnston >> wrote: >>> >>> See: >>> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php >>> http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps >>> >>> In $mystrin

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread John Taylor-Johnston
See: http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.php http://www.cegepsherbrooke.qc.ca/~languesmodernes/test/test.phps In $mystring, I need to extract everything between "|News Releases|" and "-30". The thing now is $mystring might contain many instances of "|News Releases|" and

[PHP] array_push

2012-09-02 Thread John Taylor-Johnston
How can I clean this up? My approach would be to split the hole text into smaller chunks (with e.g. explode()) and extract the interesting parts with a regular expression. Maybe this will give you some ideas: $chunks = explode("-30-", $mystring); foreach($chunks as $chunk) { preg_match

Re: [PHP] array_push

2012-09-02 Thread Frank Arensmeier
2 sep 2012 kl. 19.48 skrev John Taylor-Johnston: > How can I clean this up? >>> My approach would be to split the hole text into smaller chunks (with e.g. >>> explode()) and extract the interesting parts with a regular expression. >>> Maybe this will give you some ideas: $chunks = explode("

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread tamouse mailing lists
On Sun, Sep 2, 2012 at 11:31 AM, John Taylor-Johnston wrote: > I'll never get it. Newest work on top of the pile, instead of digging :)) Usually order reverse in flow conversations your do? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread John Taylor-Johnston
"tamouse mailing lists wrote:" Just to prove me right, our mail clients start quoting from the top too :)p tamouse mailing lists wrote: On Sun, Sep 2, 2012 at 11:31 AM, John Taylor-Johnston wrote: I'll never get it. Newest work on top of the pile, instead of digging :)) Usually order reverse

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread tamouse mailing lists
On Sun, Sep 2, 2012 at 7:57 PM, John Taylor-Johnston wrote: > Just to prove me right, our mail clients start quoting from the top too :)p Exactly. The quoting starts from the *top*. The problem is that the cursor to start typing is also put there by default. Step back before MS Outlook started th

Re: [PHP] extract Occurrences AFTER ... and before "-30-"

2012-09-02 Thread John Taylor-Johnston
tamouse mailing lists wrote: On Sun, Sep 2, 2012 at 7:57 PM, John Taylor-Johnston wrote: Just to prove me right, our mail clients start quoting from the top too :)p Exactly. The quoting starts from the *top*. The problem is that the cursor to start typing is also put there by default. Step bac

Re: [PHP] array_push

2012-09-02 Thread John Taylor-Johnston
Frank Arensmeier wrote: 2 sep 2012 kl. 19.48 skrev John Taylor-Johnston: Why not add two lines of code within the first loop? $chunks = explode("-30-", $mystring); foreach($chunks as $chunk) { preg_match_all("/News Releases\n(.+)/s", $chunk, $matches); foreach($matches[1] as $matched

[PHP] load rtf file

2012-09-02 Thread John Taylor-Johnston
I have a big giant RTF file. I could convert it to plain text. BUT can PHP do it for me? Also: I want to read the text file into a string. This does the job well, right? http://php.net/manual/en/function.file-get-contents.php This is it? Not more complicated? |http://www.example.com/text.txt'

Re: [PHP] load rtf file

2012-09-02 Thread tamouse mailing lists
On Mon, Sep 3, 2012 at 12:23 AM, John Taylor-Johnston wrote: > I have a big giant RTF file. I could convert it to plain text. BUT can PHP > do it for me? Not directly, although there might be libraries out there to do it, but none that I'm aware of off-hand. Perl, of course does this with RTF::TE