original_string: public function get_filename(moodle_url $url) {
          // Use the 'file' parameter if provided (for links created when
          // slasharguments was off). If not present, just use URL path.
          $path = $url->get_param('file');
          if (!$path) {
              $path = $url->get_path();
          }
  
          // Remove everything before last / if present. Does not use textlib as / is UTF8-safe.
          $slash = strrpos($path, '/');
          if ($slash !== false) {
              $path = substr($path, $slash + 1);
          }
          return $path;
      }
code: public function get_filename(moodle_url $url) {
          // Use the 'file' parameter if provided (for links created when
          // slasharguments was off). If not present, just use URL path.
          $path = $url->get_param('file');
          if (!$path) {
              $path = $url->get_path();
          }
  
          // Remove everything before last / if present. Does not use textlib as / is UTF8-safe.
          $slash = strrpos($path, '/');
          if ($slash !== false) {
              $path = substr($path, $slash + 1);
          }
          return $path;
      }
code_tokens: public function get_filename ( moodle_url $ url ) { // Use the 'file' parameter if provided (for links created when // slasharguments was off). If not present, just use URL path. $ path = $ url -> get_param ( 'file' ) ; if ( ! $ path ) { $ path = $ url -> get_path ( ) ; } // Remove everything before last / if present. Does not use textlib as / is UTF8-safe. $ slash = strrpos ( $ path , '/' ) ; if ( $ slash !== false ) { $ path = substr ( $ path , $ slash + 1 ) ; } return $ path ; }
docstring: Obtains the filename from the moodle_url.
  @param moodle_url $url URL
  @return string Filename only (not escaped)
docstring_tokens: Obtains the filename from the moodle_url .