Fixed checking arra indeces in php