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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -