Php Flatten Array To String In Python