Warning: Invalid argument supplied for foreach()
function cs_take_location()
{
list ($location, ) = explode(".",getenv("HTTP_HOST"));

$locations = cs_get_locations(false);

foreach...