Here is the code:
public function townUse($town) { $town = strtoupper($town); if( array_key_exists($town,$_SESSION['towns']) ){ if($_SESSION['towns'][$town] == 1){ return false; }else{ $_SESSION['towns'][$town] = 1; var_dump($_SESSION['towns']); return true; } }else{ return false; } } $ town - any city
When $ town = 1 (var_dump to help), the function still returns true, why?
PS $ _SESSION ['towns'] I filled with another function, so that it is not empty
var_dump($_SESSION['towns'])to the studio - ArchDemon