You have a large amount of duplication in your conditions. additionally you have helluva lot of hardcoded strings all over the place. I suggest you change your structure to be something like:
<?php
$gamblingStrings = ["betting", "blackjack", "casino", "football", /*... */];
//Same for your other categories and then
if (matchesCategory($site, $gamblingStrings))
{
//insert into gambling
}
//and the corresponding function
private function matchesCategory($site, $strings) {
foreach ($strings as $matcher)
{
if(strpos($site, $matcher) !== false)
{
return true;
}
}
return false;
}
Disclaimer: My PHP is extremely rusty, the provided samples could be quite borked. But I hope you get the gist of it ;)