Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Path.php

function Path::normalize

Normalizes the given path.

During normalization, all slashes are replaced by forward slashes ("/"). Contrary to {@link canonicalize()}, this method does not remove invalid or dot path segments. Consequently, it is much more efficient and should be used whenever the given path is known to be a valid, absolute system path.

This method is able to deal with both UNIX and Windows paths.

1 call to Path::normalize()
Path::canonicalize in vendor/symfony/filesystem/Path.php
Canonicalizes the given path.

File

vendor/symfony/filesystem/Path.php, line 114

Class

Path
Contains utility methods for handling path strings.

Namespace

Symfony\Component\Filesystem

Code

public static function normalize(string $path) : string {
    return str_replace('\\', '/', $path);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal