8.5.x file.inc file_uri_target($uri)
8.0.x file.inc file_uri_target($uri)
8.1.x file.inc file_uri_target($uri)
8.2.x file.inc file_uri_target($uri)
8.3.x file.inc file_uri_target($uri)
8.4.x file.inc file_uri_target($uri)
8.6.x file.inc file_uri_target($uri)
7.x file.inc file_uri_target($uri)

Returns the part of a URI after the schema.


$uri: A stream, referenced as "scheme://target".

Return value

A string containing the target (path), or FALSE if none. For example, the URI "public://sample/test.txt" would return "sample/test.txt".

See also


Related topics

11 calls to file_uri_target()
file_stream_wrapper_uri_normalize in includes/file.inc
Normalizes a URI by making it syntactically correct.
ImageStylesPathAndUrlTestCase::_testImageStyleUrlAndPath in modules/image/image.test
Test image_style_url().
image_file_download in modules/image/image.module
Implements hook_file_download().
image_style_deliver in modules/image/image.module
Page callback: Generates a derivative, given a style and image path.
image_style_path in modules/image/image.module
Returns the URI of an image when using a style.

... See full list


includes/file.inc, line 243
API for handling file uploads and server file management.


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;