Php Check If Multidimensional Array In Python