perl 中的URL ENCODE 和DECODE

      脚本天地 2005-10-26 13:37
str =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord())/seg;

$str can now be passed in the query string safely, for example:

LINK
Likely, "page_given_string.php" will want to decode $str back into something useful:

$str =~ s/\%([A-Fa-f0-9]{2})/pack('C', hex())/seg;
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}