WC_API_Authentication::urlencode_rfc3986( string|array $value )

Encodes a value according to RFC 3986. Supports multidimensional arrays.


Description Description


Parameters Parameters

$value

(Required) The value to encode


Top ↑

Return Return

(string|array) Encoded values


Top ↑

Source Source

File: includes/legacy/api/v3/class-wc-api-authentication.php

	public static function urlencode_rfc3986( $value ) {
		if ( is_array( $value ) ) {
			return array_map( array( 'WC_API_Authentication', 'urlencode_rfc3986' ), $value );
		} else {
			// Percent symbols (%) must be double-encoded
			return str_replace( '%', '%25', rawurlencode( rawurldecode( $value ) ) );
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.4 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.