首页  >  文章  >  后端开发  >  php实现对uuencode编码的字符串进行解码的函数convert_uudecode()

php实现对uuencode编码的字符串进行解码的函数convert_uudecode()

黄舟
黄舟原创
2017-11-02 10:11:121391浏览

实例

对 uuencode 编码的字符串进行解码:

<?php
$str = ",2&5L;&@=V]R;&0A `";
echo convert_uudecode($str);?>

定义和用法

convert_uudecode() 函数对 uuencode 编码的字符串进行解码。

该函数通常与 convert_uuencode() 函数一起使用。

语法

convert_uudecode(string)

参数                 D描述

string               必需。规定要解码的 uuencode 编码的字符串。    

技术细节

返回值:            以字符串形式返回解码的数据。    

PHP 版本:        5+    

更多实例

编码字符串,然后对它进行解码:

<?php
$str = "Hello world!";
// Encode the string
$encodeString = convert_uuencode($str);
echo $encodeString . "<br>";

// Decode the string
$decodeString = convert_uudecode($encodeString);
echo $decodeString;
?>

convert_uudecode实例

XML 文件:

<?xml version="1.0" encoding="ISO-8859-1"?>
<note xmlns:b="http://www.w3school.com.cn/example/">
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<b:body>Don&#39;t forget the meeting!</b:body>
</note>

PHP 代码:

<?php
if (file_exists(&#39;test.xml&#39;))
  {
  $xml = simplexml_load_file(&#39;test.xml&#39;);
  }

print_r($xml->getDocNamespaces());
?>

输出类似:

Array
(
[b] => http://www.w3school.com.cn/example/
)


以上是php实现对uuencode编码的字符串进行解码的函数convert_uudecode()的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn