See
|
$path = explode('%2F', $parts['path']); |
|
$result .= implode('%2F', array_map(function($part){ |
|
/* |
|
BUG?: paths containing, f.e., "@" are encoded. |
|
For future reference: |
|
https://tools.ietf.org/html/rfc3986#section-2.2 |
|
*/ |
|
return implode('/', array_map('rawurlencode', explode('/', $part))); |
|
}, $path)); |
Perhaps, use
array_reduce to flatten the path directly into string.
Imported from AnrDaemon/library-php#3
See
net-url/src/Net/Url.php
Lines 435 to 443 in 78602b1
Perhaps, use
array_reduceto flatten the path directly into string.