[PHP] IMAP and NNTP

2003-07-28 Thread {R}ichard Ashton
The manual says that the majority of IMAP commands can be used for NNTP access. This code works fine. $status = imap_status($nntp,{news.gradwell.net:119/nntp}#news.gradwell. lists.test,SA_ALL); if($status) { print(Messages: . $status-messages ).br\n; print(Recent: . $status-recent

[PHP] MySQL and PHP arrays

2003-03-10 Thread {R}ichard Ashton
Is there a generally recommended way of storing an array created by PHP in a MySQL database field ? What type of field should it be, and how do you get the whole array back in one go without reconstructing it row by row, if that is possible? {R} -- PHP General Mailing List

Re: [PHP] MySQL and PHP arrays

2003-03-10 Thread {R}ichard Ashton
On Mon, 10 Mar 2003 22:34:44 +0800, Jason Wong wrote: On Monday 10 March 2003 22:30, {R}ichard Ashton wrote: Is there a generally recommended way of storing an array created by PHP in a MySQL database field ? serialize() and unserialize(). What type of field should it be, and how do you get

[PHP] preg_match fails to fill $matches

2003-03-05 Thread {R}ichard Ashton
I have At the top of a loop $ts = '/(' . $trigger_string .')/is'; echo trigger_string is $ts br; $matches = array(); $hit = array(); In the loop $hit[] = preg_match ($ts, $line_in,$matches); Now the $hit array fills up correctly, if the trigger string is on the line just read in, putting

Re: [PHP] preg_match fails to fill $matches

2003-03-05 Thread {R}ichard Ashton
On Wed, 5 Mar 2003 10:21:30 -0500, 1LT John W. Holmes wrote: $ts = '/(' . $trigger_string .')/is'; echo trigger_string is $ts br; $matches = array(); $hit = array(); In the loop $hit[] = preg_match ($ts, $line_in,$matches); Now the $hit array fills up correctly, if the trigger

Re: [PHP] preg_match fails to fill $matches

2003-03-05 Thread {R}ichard Ashton
On Wed, 5 Mar 2003 12:06:41 -0500, 1LT John W. Holmes wrote: The full code in the loop is. Later on in the code after the loop I do echo printing array matches br; print_r ($matches);echo br; $matches is going to be over-written after every time through the loop! It doesn't add it all up.

Re: [PHP] String searching peformance

2003-02-26 Thread {R}ichard Ashton
On Mon, 24 Feb 2003 22:35:35 +0100, Ernest E Vogelsinger wrote: At 21:22 24.02.2003, {R}ichard Ashton spoke out and said: [snip] while ( $flag == true ) if (strpos($body, $word[]) 0) {$flag=false} What I really need to know is which is the fastest loop

[PHP] Splitting up big strings

2003-02-26 Thread {R}ichard Ashton
I have the body ov a Usnet article, all of it, in $body. I want to split it into lines. I have tried $lines = explode( X, $body); where I have used X = 0x0A X = '0x0A' X = 0x0D X = '0x0A' X = \r -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Splitting up big strings

2003-02-26 Thread {R}ichard Ashton
On Thu, 27 Feb 2003 01:02:54 +0800, Jason Wong wrote: On Thursday 27 February 2003 00:54, {R}ichard Ashton wrote: I have the body ov a Usnet article, all of it, in $body. I want to split it into lines. I have tried $lines = explode( X, $body); where I have used X = 0x0A X = '0x0A' X

Re: [PHP] String searching peformance

2003-02-26 Thread {R}ichard Ashton
On Wed, 26 Feb 2003 17:47:41 +0800, Jason Wong wrote: On Wednesday 26 February 2003 16:49, {R}ichard Ashton wrote: Do you think that: if (preg_match($re, $posting, $hits)) would slow it down at all. The $buzzwords will be kept in a file to be loaded before each run, every 5 minutes. I could

[PHP] String searching peformance

2003-02-24 Thread {R}ichard Ashton
I am looking for the most efficient way to search for Trigger words in a big string. I have a string, $body which is all of the body of any particular Usenet Post, so it can be as short as Me too and up to some, as yet undecided, limit say around 10Kbytes. I have a list of words in an array,

[PHP] PGP signing text from called from PHP

2003-01-18 Thread {R}ichard Ashton
Using PHP 4.1.2 I need to PGP sign a piece of text and detached the signature. I have read a lot in the archives and and about the better exec() calls in 4.3. However I cannot find a reference that indicates the best way to pass a set of arguments out of a PHP script to PGP. I need to use