Skip to content

Instantly share code, notes, and snippets.

@ngdanghau
Last active May 27, 2018 02:18
Show Gist options
  • Select an option

  • Save ngdanghau/f023ab0361f8a85261e77b4f6d019747 to your computer and use it in GitHub Desktop.

Select an option

Save ngdanghau/f023ab0361f8a85261e77b4f6d019747 to your computer and use it in GitHub Desktop.
<?php
$salt = '39e1e949fc21def2f2671b9dbd9712de';
$str_overral = $salt;
// bắt đầu xóa dấu cách trong string
$str_overral = preg_replace('/\s+/', '', $str_overral);
$str_res='';
for ($i=0; $i < strlen($str_overral); $i++) {
$l = $str_overral[$i];
$d = ord($str_overral[$i]); //lấy mã ASCII của ký tự
if ( floor($d/2) == $d/2 ) {
$str_res .= $l;
} else {
$str_res = $l . $str_res;
}
}
echo $str_res;
//e179917e1c99e1e934f2df2f26bdbd2d
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment