[pmwiki-devel] strange strpos problem...

The Editor editor at fast.st
Tue Apr 24 12:50:02 CDT 2007


On 4/24/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Tue, Apr 24, 2007 at 01:24:27PM -0400, The Editor wrote:
> > I've been struggling with some complicated variable functions and have
> > my head wrapped around a strange problem...
> >
> > Given this function:
> >
> > function ZAPMfunc($params) {
> >   if (strpos($params, " ") !== false) {
> >       return "yes";
> >       }
> >    else {
> >       return "nope";
> >       }
> > ...
> >
> > I've verified that $params is a string (using gettype) and that it's
> > value has a space in the middle of it. I can return $params and it's
> > exactly what it's supposed to be.
> >
> > Yet this function no matter what returns "nope" instead of "yes".
>
> There must be something else wrong with your code, as the above
> works fine for me.
>
>    http://www.pmichaud.com/sandbox/zapmfunc.php
>
> > I also tried
> >
> > function ZAPMfunc($params) {
> >    return substr($params, 1,2);
> >
> > for example and it comes up blank.
>
> Meaning it returns nothing, or it returns a blank, or ...?
>
> Pm


Very strange...  Here is the line that calls it in another subroutine elsewhere

   if (function_exists($func)) $value= $func($params);

If I do

function ZAPMfunc($params) {
   return gettype($params);

I get "string"

If I do

function ZAPMfunc($params) {
   return $params;

I get "Hello World"

But any other kinds of php commands seem to be completely dead.

I even rebooted my computer this thing is acting so weird... Any
possible ideas?  Arrrggghh...

Cheers,
Dan



More information about the pmwiki-devel mailing list