Converting hex into a text or normal string
Posted by Jawaad on 5 November, 2008
3 Comments
This item was filled under [ Code Snippet, PHP ]
Converting hex into a text or normal string using PHP code.
Fungsi mengkonvert dari tulisan bentuk hex kedalam normal string menggunakan PHP.
<?php function hex2text($hexstr) { $hex = explode('%',$hexstr); array_shift($hex); $str = ''; foreach($hex as $hexcode) { $str .= chr(base_convert($hexcode, 16, 10)); } return $str; } ?>
contoh penggunaan:
echo hex2text("%40"); // <-- akan menampilkan @ echo "<br />"; echo hex2text("%2A"); // <-- akan menampilkan * echo "<br />"; echo hex2text("%40%2A"); // <-- akan menampilkan @*
semoga mambantu ![]()
Popularity: 1,327 views


0
0
3 Comments on “Converting hex into a text or normal string”
gag bisa mas ??
Like or Dislike:udah ta’ simpan di file PHP !!