Automattic\WooCommerce\Utilities

StringUtil::normalize_local_path_slashespublic staticWC 1.0

Normalize the slashes (/ and ) of a local filesystem path by converting them to DIRECTORY_SEPARATOR.

Method of the class: StringUtil{}

No Hooks.

Returns

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() code WC 10.3.6

public static function normalize_local_path_slashes( ?string $path ) {
	return is_null( $path ) ? null : str_replace( array( '\\', '/' ), DIRECTORY_SEPARATOR, $path );
}