You can also remove both `strtolower` if you use `stripos`, as you used in the previous line.

An extra optimization is replace the `strlen($base) > 0` by `!empty($base)`