PHP convert_uuencode() Function
In this chapter you will learn:
- Definition for PHP convert_uuencode() Function
- Syntax for PHP convert_uuencode() Function
- Parameter for PHP convert_uuencode() Function
- Return for PHP convert_uuencode() Function
- Example - Encode a string
- Example - Encode a string and then decode it
Definition
The convert_uuencode() function encodes a string using the uuencode algorithm.
Syntax
PHP convert_uuencode() Function has the following syntax.
convert_uuencode(string)
Parameter
Parameter | Is Required | Description |
---|---|---|
string | Required. | The string to uuencode |
Return
PHP convert_uuencode() Function returns the uuencoded data.
Example
Encode a string:
<?php
$str = "Hello world from java2s.com!";
echo convert_uuencode($str);
?>
The code above generates the following result.
Example 2
Encode a string and then decode it:
<?php/*ja v a 2 s . c o m*/
$str = "Hello world from java2s.com!";
// Encode the string
$encodeString = convert_uuencode($str);
echo $encodeString . "\n";
// Decode the string
$decodeString = convert_uudecode($encodeString);
echo $decodeString;
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP count_chars() Function
- Syntax for PHP count_chars() Function
- Parameter for PHP count_chars() Function
- Return for PHP count_chars() Function
- Example - Get the caracter count
Home » PHP Tutorial » PHP String Functions