PHP implements the function convert_uudecode() that decodes uuencoded strings

黄舟
Release: 2023-03-16 21:48:01
Original
1455 people have browsed it

Example

Decode uuencode-encoded string:

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

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)
Copy after login

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;
?>
Copy after login

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>
Copy after login

PHP code:

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

print_r($xml->getDocNamespaces());
?>
Copy after login

Output similar to:

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


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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template