PHP 8.5.0 Alpha 1 available for testing

Voting

: nine minus seven?
(Example: nine)

The Note You're Voting On

ulterior AT one.lt
19 years ago
This seems the correct way to encode ftp url which you could provide for your users:

function ftp_url_encode($string) {

$hex="";
$retstr = "";
for ($i=0; $i < strlen($string) ;$i++) {

$char = $string[$i];
if(($char >= '0' && $char <= '9') || ($char >= 'A' && $char <= 'Z') || ($char >= 'a' && $char <= 'z') || $char == '.' || $char == '-' || $char == '/' || (ord($char) >=128) ) $retstr .= $char;
else
$retstr .= "%".strtoupper(dechex(ord($string[$i])));

}
return $retstr;
}

Browsers mangle certain language characters

<< Back to user notes page

To Top