1
I wonder how I can get the specific id of example google urls let’s say I have this url https://docs.google.com/uc?id=0B-EMwJDMPmDIUG1UeHR6ZG9Rc0E&export=download id of this url which is in the example 0B-Emwjdmpmdiug1uehr6zg9rc0e.
1
I wonder how I can get the specific id of example google urls let’s say I have this url https://docs.google.com/uc?id=0B-EMwJDMPmDIUG1UeHR6ZG9Rc0E&export=download id of this url which is in the example 0B-Emwjdmpmdiug1uehr6zg9rc0e.
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 php
You are not signed in. Login or sign up in order to post.