Encode a string and then decode it in PHP

Description

The following code shows how to encode a string and then decode it.

Example


  /*from w w  w  .  j  a  v  a2 s  .  c o m*/
<?php
   $str = "Hello world!";
   // Encode the string
   $encodeString = convert_uuencode($str);
   echo $encodeString . "<br>";
   
   // Decode the string
   $decodeString = convert_uudecode($encodeString);
   echo $decodeString;
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone