0

Is this valid PHP syntax? I think it may be causing the following warning:

Warning: Illegal offset type

$filterclear = str_replace($tag, '', $queryString);
$filterclear = str_replace(array('=+', '++', '+&'), array('=', '+', '&'), $filterclear);
2
  • possible duplicate of PHP illegal offset type in multiple loop structure Commented May 17, 2012 at 14:30
  • 1
    Errors and warnings usually print out the file name and line number where the problem occurred... Unless that information matches these two lines, your problem is somewhere else. Commented May 20, 2012 at 5:59

1 Answer 1

0

It looks fine, so the only thing I can think of is that you may be using an object instead of a string in either the $tag variable or $queryString variable. I would try var_dump()ing these variables to ensure that they are of the right type. If they are this function is most likely not the culprit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.