That won't work if "logo" appears at the start of the string; in that situation strpos($temp,'logo') would equal 0, and the condition would evaluate as false (even though 'logo' does appear in the string).
To make sure that doesn't happen, you have to check the type of the result as well, which is what === and !== do.
Maybe 'logo' never appears at the start of the string; but leaving in the !==false ensures that the the replacement is equivalent to the original (working) code.
But the main reason to use strpos instead of preg_match here is because the former does the required job much faster.