Filtering Google url id value

Asked

Viewed 25 times

1

1 answer

1


You can use the methods parse_url and parse_str.

<?php

$url = "https://docs.google.com/uc?id=0B-EMwJDMPmDIUG1UeHR6ZG9Rc0E&export=download";
$tmp = parse_url($url, PHP_URL_QUERY);
parse_str($tmp, $parametros);

print($parametros["id"]);

?>

Example: http://ideone.com/k337X8

Browser other questions tagged

You are not signed in. Login or sign up in order to post.