| Versions | |
|---|---|
| 7 | file_uri_target($uri) |
Returns the part of an URI after the schema.
$uri A stream, referenced as "scheme://target".
A string containing the target (path), or FALSE if none. For example, the URI "public://sample/test.txt" would return "sample/test.txt".
drupal/
<?php
function file_uri_target($uri) {
$data = explode('://', $uri, 2);
// Remove erroneous leading or trailing, forward-slashes and backslashes.
return count($data) == 2 ? trim($data[1], '\/') : FALSE;
}
?>