<?php
$str = "The game start in a minute, remove all of the corks from these bottles in the cellar they're in";
$useless_words = ["the", "of", "or", "in", "a"];
var_dump(
preg_replace('/(\s+)?\b(?:' . implode('|', $useless_words) . ')\b(?(1)|\s+)/i', '', $str)
);