Encode and decode text by decimal
Demo:
Snippet :
Demo:
Snippet :
PHP Code:
<?php
$string=$_POST['text'];
$stringdecript=$_POST['textdecript'];
$print="<textarea cols=\"15\" rows=\"1\" readonly=\"readonly\" onfocus=\"this.select()\">".$string."</textarea>";
echo"Before:<br>".$print." <br>";
echo'Encrypt your text:<br><form action="decimal.php" method="post"><textarea cols="10" name="text" rows="1" style="width:300px;height:100px;" value="" id="code_txt" onfocus="this.select()">';
unick($string);
echo'</textarea><br><input type="submit" value="Encrypt"></form>';
$stringdec=str_replace('&','&',$stringdecript);
$print="<textarea cols=\"15\" rows=\"1\" readonly=\"readonly\" onfocus=\"this.select()\">".$stringdec."</textarea>";
echo"Before:<br>".$print." <br>";
echo'Decrypt your text:<br><form action="decimal.php" method="post"><textarea cols="10" name="textdecript" rows="1" style="width:300px;height:100px;" value="" id="code_txt" onfocus="this.select()">';
echo"$stringdecript";
echo'</textarea><br><input type="submit" value="Decrypt"></form>';
function unick($string){
for($i=0;$i<strlen($string);$i++) {
echo "&#".ord($string{$i}).";"; }
}
?>