jnck

sesuatu

Dec 24th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. function Hilangin($hex){
  3. // hapus /x dari hex
  4. $hex = str_replace('/x', '', $hex);
  5. return ($hex);
  6. }
  7.  
  8. function hexketext($x) {
  9. $s='';
  10. foreach(explode("\n",trim(chunk_split($x,2))) as $h) $s.=chr(hexdec($h));
  11. return($s);
  12. }
  13.  
  14. function textkehex($x) {
  15. $s='';
  16. foreach(str_split($x) as $c) $s.=sprintf("%02X",ord($c));
  17. return($s);
  18. }
  19.  
  20. $hex = "47/x4c/x4f/x42/x41/x4c/x53";
  21. print hexketext(Hilangin($hex)).'<br>';
  22.  
  23. print textkehex("GLOBALS")."\n";
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment