我想将每个元素连接到下一个元素。我想输出数组是:foreach将每个元素连接到下一个
Array
(
[0] => test
[1] => test/test2
[2] => test/test2/test3
[3] => test/test2/test3/test4
)
我尝试以下方法,其串接每个字符串本身:
$url = preg_split("/[\s\/]+/", "test/test2/test3/test4");
foreach ($url as $dir) {
$dir .= $dir;
}
任何帮助表示赞赏。
你有错误吗? ..错误的结果? .. 没有结果 ? .. 有什么问题? – scaisEdge
你放弃了还是什么? – AbraCadaver