- 论坛徽章:
- 0
|
原帖由 eviltom 于 2007-2-6 01:16 发表
$src_url = 'http%3A%2F%2Fliveu-11.vo.llnwd.net%2Fflurl%2Fma71%2Fnew_media3%2F2007%2F1%2F30%2
F123.mpg'
$src_url =~ s/%3A/:/g;
$src_url =~ s/%2F/\//g;
output 是:
[url]http://liveu-11.vo.llnwd ...
Hi,
Why don't use CPAN module URI::Escape?
For example to unescape your $src_url (encoded URI):
- use URI::Escape;
- $src_url = 'http%3A%2F%2Fliveu-11.vo.llnwd.net%2Fflurl%2Fma71%2Fnew_media3%2F2007%2F1%2F30%2
- F123.mpg';
- $real_url = uri_unescape($src_url);
- print $real_url, "\n";
- # --- out ---
- # http://liveu-11.vo.llnwd.net/flurl/ma71/new_media3/2007/1/30/123.mpg
复制代码
-- ulmer |
|