siverson101

Results 2 comments of siverson101

What you want is use a startsWith check. Maybe add these to the helper class: function startsWith($haystack, $needle) { $length = strlen($needle); return (substr($haystack, 0, $length) === $needle); } function...

You could also do: // Strip off ;charset=UTF-8 from Content-Type: text/javascript;charset=UTF-8 $pos = strpos($content_type, ';'); if ($pos !== false) { $content_type = substr($content_type, 0, $pos - 1); }