本文 14939 pv

1

把链接的汉字进行转换-urlencode

© kekehu / 技术资源 / 2008.11.29 / 10:44 / 14939PV

要求:把下面的链接的汉字进行urlencode转换

03月06日:<a href="ftp://m:f@vip.mh2004.com/hsfucktx/20080103-萧皇后.mp3" target="_blank">20080103-萧皇后</a><br />
03月06日:<a href="ftp://m:f@vip.mh2004.com/hsfucktx/20080104-姊妹花闹乱后宫.mp3" target="_blank">20080104-姊妹花闹乱后宫</a><br />
03月06日:<a href="ftp://m:f@vip.mh2004.com/hsfucktx/20080105-丑女贾南风乱政.mp3" target="_blank">20080105-丑女贾南风乱政</a><br />


程序:
index.html文件内容:
<form action="replace.php" method="post" enctype="multipart/form-data" name="form1" target="_blank">
  <table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#666666">

    <tr>
    <td bgcolor="#FFFFFF">选择文件:</td>
    <td bgcolor="#FFFFFF"><input type="file" name="rfile" /></td>
    </tr>
    <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"><input type="submit" value="提交" />
      <input type="reset" name="Submit" value="重置" /></td>
    </tr>
  </table>
</form>


replace.php程序内容:
$file = $_FILES['rfile'];
$string = file_get_contents($file['tmp_name']); //读取文本
//开始替换
$array = explode("
", $string); foreach ($array as $v) { if ($v != '') {//每个链接值 $line_row = explode("", $line_row[1]); $line_ther = explode("ftp://m:f@vip.mh2004.com/hsfucktx/",$line_two[0]); $url_play=urlencode($line_ther[1]); echo $line_row[0]."{$line_two[1]}
"; } }

本文有 1 篇评论

  1. @ nihao 说 :
    2008.12.08 18:19
    avatar

    badbadbadbadbadbadbadbad

1/1 第一页 1 最后页

发表你的见解

打开HTML 打开UBB 打开表情 隐藏 记住我
emotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemotemot
emotemotemotemotemot