file_uri_target

  1. drupal
    1. 7
Versions
7 file_uri_target($uri)

Returns the part of an URI after the schema.

Parameters

$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

file_uri_scheme()

Related topics

▾ 9 functions call file_uri_target()

file_stream_wrapper_uri_normalize in drupal/includes/file.inc
Normalizes a URI by making it syntactically correct.
file_test_file_url_alter in drupal/modules/simpletest/tests/file_test.module
Implements hook_file_url_alter().
hook_file_url_alter in drupal/modules/system/system.api.php
Alter the URL to a file.
image_file_download in drupal/modules/image/image.module
Implements hook_file_download().
image_style_deliver in drupal/modules/image/image.module
Menu callback; Given a style and image path, generate a derivative.
image_style_path in drupal/modules/image/image.module
Return the URI of an image when using a style.
image_style_url in drupal/modules/image/image.module
Return the URL for an image derivative given a style and image path.
system_theme_settings in drupal/modules/system/system.admin.inc
Form builder; display theme configuration for entire site and individual themes.
user_file_download in drupal/modules/user/user.module
Implements hook_file_download().

Code

drupal/includes/file.inc, line 248

<?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;
}
?>