i have this:
$badWords = array("ban","bad","user","pass","stack","name","html");
$string = 'http://rpmrush.com/uploads/bangalleries/51/original/5e17a20aafe8799843305b7663e6683eda7b3eae.jpg';
$matches = array();
$matchFound = preg_match_all(
"/\b(" . implode($badWords,"|") . ")\b/i",
$string,
$matches
);
if ($matchFound) {
$return['bannedURL'] = true;
echo json_encode($return);
die();
}
Which works fine when the string is simply one of the banned words.
On my website i have a feature for users to enter image urls and they get added, however to stop the users putting illegal etc images (porn and the like) and also using my server as a host for their dodgey images i want to create a list of adult websites and such and then check the input URL against it.
The above code only checks if the string is an exact match, how can i change this to make it work if part of the string matches?