$url = explode('/', '/article/category-5/status-2/page-3'); $params = array(); foreach ($url as $v)
{
$temp = explode('-', $v);
if (isset($temp[1]))
$params[$temp[0]] = $temp[1];
} var_dump($params);
2022-02-20 00:42:46
$url = explode('/', '/article/category-5/status-2/page-3'); $params = array(); foreach ($url as $v)
{
$temp = explode('-', $v);
if (isset($temp[1]))
$params[$temp[0]] = $temp[1];
} var_dump($params);