convert_uudecode
(PHP 5)
convert_uudecode — Decode a uuencoded string
Description
string convert_uudecode
( string
$data
)convert_uudecode() decodes a uuencoded string.
Parameters
-
data
-
The uuencoded data.
Return Values
Returns the decoded data as a string or FALSE
on failure.
Examples
Example #1 convert_uudecode() example
<?php
/* Can you imagine what this will print? :) */
echo convert_uudecode("+22!L;W9E(%!(4\"$`\n`");
?>
- addcslashes
- addslashes
- bin2hex
- chop
- chr
- chunk_split
- convert_cyr_string
- convert_uudecode
- convert_uuencode
- count_chars
- crc32
- crypt
- echo
- explode
- fprintf
- get_html_translation_table
- hebrev
- hebrevc
- hex2bin
- html_entity_decode
- htmlentities
- htmlspecialchars_decode
- htmlspecialchars
- implode
- join
- lcfirst
- levenshtein
- localeconv
- ltrim
- md5_file
- md5
- metaphone
- money_format
- nl_langinfo
- nl2br
- number_format
- ord
- parse_str
- printf
- quoted_printable_decode
- quoted_printable_encode
- quotemeta
- rtrim
- setlocale
- sha1_file
- sha1
- similar_text
- soundex
- sprintf
- sscanf
- str_getcsv
- str_ireplace
- str_pad
- str_repeat
- str_replace
- str_rot13
- str_shuffle
- str_split
- str_word_count
- strcasecmp
- strchr
- strcmp
- strcoll
- strcspn
- strip_tags
- stripcslashes
- stripos
- stripslashes
- stristr
- strlen
- strnatcasecmp
- strnatcmp
- strncasecmp
- strncmp
- strpbrk
- strpos
- strrchr
- strrev
- strripos
- strrpos
- strspn
- strstr
- strtok
- strtolower
- strtoupper
- strtr
- substr_compare
- substr_count
- substr_replace
- substr
- trim
- ucfirst
- ucwords
- vfprintf
- vprintf
- vsprintf
- wordwrap
Коментарии
This functionality is now implemented in the PEAR package PHP_Compat.
More information about using this function without upgrading your version of PHP can be found on the below link:
http://pear.php.net/package/PHP_Compat
Code snippet for retrieving Encoded passwords stored in mysql database .
Consider a file named "test.php" consisting of an input form as given below:
<html>
<body>
<form action="test.php" method="post">
<input type="text" name="fname" id="fname" />
<input type="password" name="password" id="password" />
<input type="submit" name="submit" value="submit" />
</form>
<?
/*
below php code takes input field values , encode the password and then store the values in a database .
Create a table named test with fields id,name,password where id is auto incremented..
*/
if(isset($_post['submit']))
{
$fname=$_POST['fname'];
$pass=$_POST['password'];
$encoded_pass=convert_uuencode($pass);
$con=mysql_connect("your hostname","your username","your password"); //connecting to the database
$db=mysql_select_db("your_database_name",$con);
$sql="INSERT INTO test (id,name,password) VALUES('','$fname', '$encoded_pass' )";
$result=mysql_query($sql)or die("unable to insert");
/****encoding and storing ends here******/
/* Code snippet for retrieving the last inserted entry from the database and decoding starts here */
$id2=mysql_insert_id(); // id of the last entry
$sql2="select password from test where id='$id2' ";
$result2=mysql_query($sql2);
$row=mysql_fetch_array($result2);
$decoded_pass=convert_uudecode($row[0]); //decoding takes place here
echo "decoded password: ".$decoded_pass;
}
?>
</body>
</html>