Re: [PHP] Re: strange stripos behavior

2007-07-24 Thread Richard Lynch
On Tue, July 24, 2007 8:30 pm, Robert Cummings wrote: > On Tue, 2007-07-24 at 20:03 -0500, Shawn McKenzie wrote: >> For another guru, I have a question. I just checked the returns of >> this >> func on php.net to check myself and I see: >> >> This function may return Boolean FALSE, but may also

Re: [PHP] Re: strange stripos behavior

2007-07-24 Thread Shawn McKenzie
Yes, I understand that, but it said that "this function" may return 0 or "". So I guess that is just a generic statement to illustrate the point. -Shawn Robert Cummings wrote: > On Tue, 2007-07-24 at 20:03 -0500, Shawn McKenzie wrote: >> For another guru, I have a question. I just checked the

Re: [PHP] Re: strange stripos behavior

2007-07-24 Thread Robert Cummings
On Tue, 2007-07-24 at 20:03 -0500, Shawn McKenzie wrote: > For another guru, I have a question. I just checked the returns of this > func on php.net to check myself and I see: > > This function may return Boolean FALSE, but may also return a > non-Boolean value which evaluates to FALSE, such as 0

Re: [PHP] Re: strange stripos behavior

2007-07-24 Thread Shawn McKenzie
For another guru, I have a question. I just checked the returns of this func on php.net to check myself and I see: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or "". When would stripos() return "" ? Thanks! -Shawn Bruce Co

Re: [PHP] Re: strange stripos behavior

2007-07-24 Thread Shawn McKenzie
OK, so I've had at least 2 more beers since the last reply, but I'll give a shot. I don't know what text is in your message, but here's my logic, so it would depend upon what was concatenated first: Your statement read: if (not) stripos($searchtext, ''), which means false, '' or 0 (which it

[PHP] Re: strange stripos behavior

2007-07-24 Thread Bruce Cowin
Thanks for the suggestion. I ended up not building the search string and checking each part individually. FYI, I had noticed that it also depended on what order I built the search string; e.g., $searchstring = $msg->Body() . $msg->Subject()... worked ok but if I put $msg->Subject first it didn

[PHP] Re: strange stripos behavior

2007-07-24 Thread Shawn McKenzie
Too much beer to think through the logical progression of the operators, but maybe try: if (stripos($searchtext, '') !== false) { -Shawn Bruce Cowin wrote: > I'm using PHP 5.1 on IIS. I have an app that uses MimeDecode to load > mime files and I've built an object to parse them into their v