[PHP] Re: Matching

2009-01-31 Thread Shawn McKenzie
Ron Piggott wrote: > How do I determine the value oftx from this string? > > > page/words_from_the_well_checkout/?tx=8UM53005HH344951T&st=Completed&amt=0.01 > > My desired answer is: 8UM53005HH344951T > > I am trying to capture the serial number which follows tx= and ends > immediately be

Re: [PHP] Re: Matching Proper Versions Of PHP and MySQL

2007-03-05 Thread Chris
zerof wrote: revDAVE escreveu: Hello All, I'm a newbie. My server just upgraded to PHP version 5.1.2 from php 4.3.11 MySQL currently is v 4.0.27 Q: What is the oldest - best/safest version of mySQL to use with PHP version 5.1.2.? The reason I mentioned the oldest - is because, for legacy

[PHP] Re: Matching Proper Versions Of PHP and MySQL

2007-03-05 Thread zerof
revDAVE escreveu: Hello All, I'm a newbie. My server just upgraded to PHP version 5.1.2 from php 4.3.11 MySQL currently is v 4.0.27 Q: What is the oldest - best/safest version of mySQL to use with PHP version 5.1.2.? The reason I mentioned the oldest - is because, for legacy clients, I would

[PHP] Re: Matching logins to an old htpasswd file

2007-03-04 Thread Fergus Gibson
Ryan A wrote: > Hey, I have a old htpasswd file with a lot of logins in this format: > > test:dGRkPurkuWmW2 (test:test) test1:dGlAW3zdxeAG2 (test1:test1) > > now I have a login form what takes a POST "user" and a POST "pw"... > but if you look at my above first example login.. the username and >

[PHP] Re: Matching numbers 1-100

2007-02-03 Thread bit-bucket
On Sat, 3 Feb 2007 12:58:19 -0500, tedd wrote: > At 5:09 PM + 2/3/07, Wikus Moller wrote: >>Hi. >> >>I want to know if anyone can help me with my code which matches a >>number to a range e.g. 1-15 and echoes an image if the number is in >>the range. >> >>The code would use the if statement and

[PHP] Re: Matching Number of Times a Word Occurs...

2005-04-19 Thread Al
Russell P Jones wrote: Im trying to count the number of times a word occurs in a string - is the only way to do this preg_match_all? Russ Jones No, there are hundreds of other ways; but, preg_match_all() is probably the easiest. $number= preg_match_all("%$word%sm", $string, $matches); -- PHP Gen

Re: [PHP] Re: Matching *exact* string?

2004-10-31 Thread Nick Wilson
* and then Greg Donald declared > On Sun, 31 Oct 2004 12:58:04 +0100, Nick Wilson <[EMAIL PROTECTED]> wrote: > > I think in_array() sounds like a great solution, wonder if it's faster > > than comparing each ooe with == ? thanks! > > Benchmark it both ways and find out. Then post back and te

Re: [PHP] Re: Matching *exact* string?

2004-10-31 Thread Greg Donald
On Sun, 31 Oct 2004 12:58:04 +0100, Nick Wilson <[EMAIL PROTECTED]> wrote: > I think in_array() sounds like a great solution, wonder if it's faster > than comparing each ooe with == ? thanks! Benchmark it both ways and find out. Then post back and tell us. :) -- Greg Donald Zend Certified Eng

Re: [PHP] Re: Matching *exact* string?

2004-10-31 Thread Nick Wilson
* and then Daniel Schierbeck declared > I'd rather go with something like this: > > $banned_ips = array('123.123.123.123', '321.321.321.321'); // Banned IPs > > if (in_array($_SERVER['REMOTE_ADDR'], $banned_ips)) { > die('Dude, you\'re banned!'); > } > > But if I were you I'd choose s

Re: [PHP] Re: Matching *exact* string?

2004-10-31 Thread Nick Wilson
* and then Per Jessen declared > foreach($ips as $ip) { > preg_match("/^$ip$/", $_SERVER[REMOTE_ADDR]); > $ban = TRUE; > } Great! - found a more sutable way but that's appreciated. Cheers! -- Nick W -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph

Re: [PHP] Re: Matching *exact* string?

2004-10-31 Thread Nick Wilson
* and then Aidan Lister declared > I cannot fathom why you would use preg_match for this. > > This will get an "exact match"... > if ($ip == $_SERVER[REMOTE_ADDR]) { $ban = true; } Ahh.. an oversight. The script has been cobbled together from a previous version that supported partial matches

[PHP] Re: Matching *exact* string?

2004-10-31 Thread Daniel Schierbeck
Daniel Schierbeck wrote: Nick Wilson wrote: hello all I am foreach()ing through an array of ip addresses in a 'ban script' and have the following php code: foreach($ips as $ip) { preg_match("/$ip/", $_SERVER[REMOTE_ADDR]); $ban = TRUE; } This is great, but if 127.0.0 were in the ban list (for e

[PHP] Re: Matching *exact* string?

2004-10-31 Thread Daniel Schierbeck
Nick Wilson wrote: hello all I am foreach()ing through an array of ip addresses in a 'ban script' and have the following php code: foreach($ips as $ip) { preg_match("/$ip/", $_SERVER[REMOTE_ADDR]); $ban = TRUE; } This is great, but if 127.0.0 were in the ban list (for example) it would still pr

[PHP] Re: Matching *exact* string?

2004-10-31 Thread Aidan Lister
I cannot fathom why you would use preg_match for this. This will get an "exact match"... if ($ip == $_SERVER[REMOTE_ADDR]) { $ban = true; } Despite this being the worst idea I've ever seen, combined with a true lack of understanding, I wish you well. "Nick Wilson" <[EMAIL PROTECTED]> wrote in

[PHP] Re: Matching *exact* string?

2004-10-31 Thread Per Jessen
Nick Wilson wrote: > hello all > > I am foreach()ing through an array of ip addresses in a 'ban script' and > have the following php code: > > foreach($ips as $ip) { > preg_match("/$ip/", $_SERVER[REMOTE_ADDR]); > $ban = TRUE; > } > > This is great, but if 127.0.0 were in the ban list (for

[PHP] Re: Matching titles from distinct data sources

2003-06-03 Thread James Robertson
That's great, thanks David :-) For anyone who is interested I also got some helpful responses in, news://comp.ai.fuzzy Cheers James "David Robley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > says... > > Hello > > > > Does anyo

[PHP] Re: Matching titles from distinct data sources

2003-05-29 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hello > > Does anyone know of an algorithm or program for matching pieces of text > (such as film titles) that are conceptually the same, but which may be > written/spelled differently? > > eg. I need something which will identify a (li