Unnecessary loop, use `$revised_array = array_intersect($themes, $availablethemes);`