Re: [PHP] Comparing strings (revisited)

2009-05-27 Thread Clancy
On Mon, 25 May 2009 02:11:24 -0400, pa...@quillandmouse.com (Paul M Foster) wrote: . > >This is why I originated a thread along these lines some time ago. I >sympathize with your pain, being a C programmer as well. Apparently, PHP >plays fast and loose with types when doing == comparison

Re: [PHP] Comparing strings (revisited)

2009-05-24 Thread Paul M Foster
On Mon, May 25, 2009 at 12:46:16PM +1000, Clancy wrote: > For some time I have been working on a text based database, in which each > entry contains > one or more lines of data, with the various fields delimited by semicolons, > e.g. > > A;b;20GM;Restaurant;090508 > n;;;Arintji;; > a;Federati

Re: [PHP] Comparing strings (revisited)

2009-05-24 Thread Eddie Drapkin
With the initial explode, I may be wrong but I don't think it's possible to force every entry to be string-typed. However, this little snippet could help: $foo = explode(';', $db); foreach($foo as &$bar) { $bar = settype($bar, 'string); } which will set each element's type to string, but is hardl

[PHP] Comparing strings (revisited)

2009-05-24 Thread Clancy
For some time I have been working on a text based database, in which each entry contains one or more lines of data, with the various fields delimited by semicolons, e.g. A;b;20GM;Restaurant;090508 n;;;Arintji;; a;Federation Square;;; p;9663 9900;;;9663 9901;;i...@arintji.com.au; All was goin