1. drupal
    1. 8
    2. 7
8 – 7 file_uri_target($uri)

Returns the part of an 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

▾ 13 functions call file_uri_target()

file_stream_wrapper_uri_normalize in includes/
Normalizes a URI by making it syntactically correct.
file_test_file_url_alter in modules/simpletest/tests/file_test.module
Implements hook_file_url_alter().
hook_file_download in modules/system/system.api.php
Control access to private file downloads and specify HTTP headers.
hook_file_url_alter in modules/system/system.api.php
Alter the URL to a file.
ImageExampleTestCase::testImageExamplePage in examples/image_example/image_example.test
Tests for image block provided by module.
image_file_download in modules/image/image.module
Implements hook_file_download().
image_style_deliver in modules/image/image.module
Menu callback; Given a style and image path, generate a derivative.
image_style_path in modules/image/image.module
Return the URI of an image when using a style.
image_style_url in modules/image/image.module
Return the URL for an image derivative given a style and image path.
StreamWrapperTest::testUriFunctions in modules/simpletest/tests/file.test
Test the URI and target functions.
system_theme_settings in modules/system/
Form builder; display theme configuration for entire site and individual themes.
UserPictureTestCase::testPictureIsValid in modules/user/user.test
Do the test: Picture is valid (proper size and dimension)
user_file_download in modules/user/user.module
Implements hook_file_download().


includes/, line 247

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;