w3resource

PHP : convert_uuencode() function

Description

The convert_uuencode() function is used to encode a uuencoded string.

Version

(PHP 5)

Syntax

convert_uuencode(string_data)

Parameter

Name Description Required /
Optional
Type
string_data The uuencoded data. Required String

Return values

Returns the uuencoded data

Value Type: String.

Pictorial Presentation

php-string-convert_uuencode()

Example:

<?php
$string_data = "Good Morning...";
echo convert_uuencode($string_data);
?>

Output:

/1V]O9"!-;W)N:6YG+BXN

View the example in the browser

See also

PHP Function Reference

Previous: convert_uudecode
Next: count_chars



PHP: Tips of the Day

Deep flattens an array

Example:

<?php
function tips_deepFlatten($items)
{
  $result = [];
  foreach ($items as $item) {
    if (!is_array($item)) {
      $result[] = $item;
    } else {
      array_push($result, ...tips_deepFlatten($item));
    }
  }

  return $result;
}

Print_r(tips_deepFlatten([1, [2], [[3], 4], 5]));
?>

Output:

Array
(
    [0] => 1
    [1] => 2
    [2] => 3
    [3] => 4
    [4] => 5
)