<?php
function myUrlEncode($string)
{
$entities = array('%21', '%2A', '%27', '%28', '%29', '%3B', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%2F', '%3F', '%25', '%23', '%5B', '%5D');
$replacements = array('!', '*', "'", "(", ")", ";", ":", "@", "&", "=", "+", "$", ",", "/", "?", "%", "#", "[", "]");
return str_replace($entities, $replacements, rawurlencode($string));
}
echo myUrlEncode('http://192.168.8.232/红尘情歌 高安.mp4');
//输出 http://192.168.8.232/%E7%BA%A2%E5%B0%98%E6%83%85%E6%AD%8C%20%E9%AB%98%E5%AE%89.mp4
: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in
评论 (0)