Home  >  Article  >  Backend Development  >  PHP implements the function convert_uudecode() that decodes uuencoded strings

PHP implements the function convert_uudecode() that decodes uuencoded strings

黄舟
黄舟Original
2017-11-02 10:11:121395browse

Example

Decode uuencode-encoded string:

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

Definition and usage

convert_uudecode() function decodes uuencode-encoded characters The string is decoded.

This function is usually used together with the convert_uuencode() function.

Syntax

convert_uudecode(string)

Parameters             DDescription

string                                        Specifies the uuencoded string to be decoded. ​

Technical details

Return value: ​ ​ ​Return the decoded data in string form.

PHP Version: 5+

More Examples

Encode a string and then decode it:

<?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 Example

XML file:

<?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 code:

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

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

Output similar to:

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


The above is the detailed content of PHP implements the function convert_uudecode() that decodes uuencoded strings. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn