regex - php preg_match_all: How to get aparat video id from URL? -
regex - php preg_match_all: How to get aparat video id from URL? -
i want video id aparat's url php preg_match_all;
example aparat url formats:
http://www.aparat.com/v/3fjn0
i want "3fjn0"
?
you can utilize next code.
<?php $url = 'http://www.aparat.com/v/3fjn0'; $path = parse_url($url, php_url_path); $matches = preg_split("/\/v/", $path); print_r($matches[1]);
php regex
Comments
Post a Comment