我需要以下结构的数组:
Array
(
[www.example.com] => Array
(
[0] => http://www.example.com/
[1] => http://www.example.com/something.html
[2] => http://www.example.com/anything.html
)
[www.beispiel.com] => Array
(
[0] => http://www.beispiel.com/product-services/
[1] => http://www.beispiel.com/non-disclosure-agreement/
)
)
作为输入数组,我有以下两个
Array ( [0] => http://www.example.com/
[1] => http://www.example.com/something.html
[2] => http://www.example.com/anything.html
[3] => http://www.beispiel.com/product-services/
[4] => http://www.beispiel.com/non-disclosure-agreement/
)
和
Array ( [0] => www.example.com [1] => www.beispiel.com )
此刻我有这样的事情:
Array
(
[0] => Array
(
[www.example.com] => http://www.example.com/
)
[1] => Array
(
[www.example.com] => http://www.example.com/something.html
)
[2] => Array
(
[www.example.com] => http://www.example.com/anything.html
)
[3] => Array
(
[www.beispiel.com] => http://www.beispiel.com/product-services/
)
[4] => Array
(
[www.beispiel.com] => http://www.beispiel.com/non-disclosure-agreement/
)
)
这是可能的还是我错过了一些关于 php 的信息(例如 key 不能是解析的 url(主机))?