0

I'm trying to check if <script or <link is in a string.

if (stripos($string, '<script') !== FALSE || stripos($string, '<link') !== FALSE)

The code above never finds the match unless I take out the < Do I need to escape that character or something? I tried preg_match('~\b<script\b~',$string) and that failed as well.

I'm sure I'm missing something simple. Any help is greatly appreciated.

Thanks in advance

UPDATE: str_ireplace(array('<script','<link'), array('<replacescript','<replacelink'), $string) does not work either

Twitch
  • 233
  • 2
  • 7

0 Answers0