Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - What does Warning: strpos() [function.strpos]: Empty delimiter in mean?

Tags:

php

What does Warning: strpos() [function.strpos]: Empty delimiter in mean?

I have this:

    if(strpos(''', $text) === false)
    {
        $text = str_replace(''', "'", $text);
    }
like image 851
Woppi Avatar asked Nov 05 '10 10:11

Woppi


1 Answers

At a guess, I'd say $text is an empty string (thanks Mark for pointing out the specifics)

Edit: Also, another guess is you have the parameters in the wrong order. The method signature of strpos is

int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] )

See http://php.net/manual/en/function.strpos.php

like image 61
Phil Avatar answered Sep 28 '22 04:09

Phil