You can just do `substr($data_type, -2) == '[]'`