["1",["2","3", ["4", "5", ["6"]]]]
["1",["2","3", ["4", "5", ["6"]]]]
function a(arr){
return arr.map((item,i)=>Array.isArray(item)?a(item):encodeURI(item));
//encodeURI
}
let arr = ['1',['2','3', ['4', '5', ['6']]]];
console.log(a(arr));
php
public function b($arr = array()) {
if (!empty($arr)) {
return "";
} else {
foreach ($arr as &$v) {
if (is_array($v)) {
$v = $this->b($v);
} else {
$v = $v + 1;
}
}
return $arr;
}
}
? >
Previous: The binding event in the react parent component is invalid.
Next: How to change the default port 3000 after creating a project with create-react-app?