Automattic\WooCommerce\Utilities
StringUtil::normalize_local_path_slashes()
Normalize the slashes (/ and ) of a local filesystem path by converting them to DIRECTORY_SEPARATOR.
Method of the class: StringUtil{}
No Hooks.
Return
String|null
. Normalized path, or null if the input was null.
Usage
$result = StringUtil::normalize_local_path_slashes( ?string $path );
- ?string $path (required)
- -
StringUtil::normalize_local_path_slashes() StringUtil::normalize local path slashes code WC 9.4.2
public static function normalize_local_path_slashes( ?string $path ) { return is_null( $path ) ? null : str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, $path ); }