arrayToString
<?php
$arr = [
['张三','男','22'],
['李四','女','23'],
['王五','男','24'],
['赵六','女','25'],
];
//张三,男,22|李四,女,23|王五,男,24|赵六,女,25
foreach ($arr as $item){
$temp[] = implode(',',$item);
}
$str = implode('|',$temp);
echo $str;