PHP hex2bin() not working on some strings

  backend, html, php, server

The function hex2bin works on a string when I manually asign it but when grabbed from POST request it just gives no response . anyone can help ?

$validator = $_POST["validator"];

echo $validator; //Gives this response "a6025c7719d0d87dcdf5f398dde9838b4fc00a14d56152aaac78ab32d55023f3"
echo "<br>";
$var = "a6025c7719d0d87dcdf5f398dde9838b4fc00a14d56152aaac78ab32d55023f3";
echo $var;
echo "<br>";
echo hex2bin($_POST["validator"]); //Gives no response
echo "<br>";
echo hex2bin($var); //Gives response 

Source: Ask PHP

LEAVE A COMMENT