Please validate the solution. If you accept this, contact me for the payment:
function bcd_to_string($lng_value){
$str_return = "";
$int_loop = 0;
$str_bin = sprintf("%'.032b", $lng_value);
for ($int_loop = 0; $int_loop<25; $int_loop += 8){
$str_return = sprintf("%c",bindec(substr($str_bin,$int_loop, 8))).$str_return;
}
return trim($str_return,sprintf("%c",0));
}
function string_to_bcd($str_time) {
$str_binary = "";
$int_loop = 0;
for($int_loop = 0; $int_loop<4; $int_loop ++){
$str_binary .= sprintf("%'.04b", substr($str_time,$int_loop, 1));
}
return bindec($str_binary);
}