file_uri_scheme
- Versions
- 7
file_uri_scheme($uri)
Returns the scheme of a URI (e.g. a stream).
Parameters
$uri A stream, referenced as "scheme://target".
Return value
A string containing the name of the scheme, or FALSE if none. For example, the URI "public://example.txt" would return "public".
Related topics
Code
includes/file.inc, line 141
<?php
function file_uri_scheme($uri) {
$data = explode('://', $uri, 2);
return count($data) == 2 ? $data[0] : FALSE;
}
?>Login or register to post comments 