답변 1개 / 댓글 1개
채택된 답변
+20 포인트
정규식보다 간편하게 이런 방식은 어떤가요?
Copy
<?php
$str = 'https://a.com/abc/12345/d/e/f';
echo $str;
$url = parse_url($str);
if (empty($url['path']) === false) {
$paths = explode('/', $url['path']);
array_shift($paths);
print_r($paths);
}
?>
답변을 작성하려면 로그인이 필요합니다.