function file_uri_scheme

Returns the scheme of a URI (e.g. a stream).


$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".

See also


Related topics

31 calls to file_uri_scheme()
drupal_dirname in drupal/includes/
Gets the name of the directory from a given path.
drupal_load_stylesheet in drupal/includes/
Loads the stylesheet and resolves all @import commands.
drupal_rmdir in drupal/includes/
Removes a directory.
drupal_tempnam in drupal/includes/
Creates a file with a unique filename in the specified directory.
drupal_unlink in drupal/includes/
Deletes a file.

... See full list


drupal/includes/, line 199
API for handling file uploads and server file management.


function file_uri_scheme($uri) {
  $position = strpos($uri, '://');
  return $position ? substr($uri, 0, $position) : FALSE;