$url = 'http://test.com/?u=http%3A%2F%asdasddd2F&e=AT0Qsw71pC1-W5qM0W';
url이 이런식으로 뒤에 파라미터있는것들을
echo $url; 했을때
http://test.com 으로나오게하는 함수가 있나요?
정규식으로 url만 추출하시면 되지 않을까요?
<?php $url = 'http://test.com/?u=http%3A%2F%asdasddd2F&e=AT0Qsw71pC1-W5qM0W'; preg_match('/http(?:s)?\:\/\/[^\" ]+\//i', $url, $match); echo ($match[0]); ?>
정규식으로 url만 추출하시면 되지 않을까요?
<?php
$url = 'http://test.com/?u=http%3A%2F%asdasddd2F&e=AT0Qsw71pC1-W5qM0W';
preg_match('/http(?:s)?\:\/\/[^\" ]+\//i', $url, $match);
echo ($match[0]);
?>