What is the PHP equivalent of MySQL UNHEX ()?
For example, the following query and the PHP function must provide the same value.
SELECT UNHEX(c1) AS unhexed_c1 FROM table; $unhexed_c1=PHPs_UNHEX_Equivalent($c1);
There is a built-in hex2bin function if you use PHP> = 5.4.
This can be done using pack :
pack
$unhexed = pack('H*', $hexstring);
See How to convert hex to string or text in php :
function unhex($hex) { for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2))); return $str; }
I think you are looking for hex2bin
Source: https://habr.com/ru/post/954851/More articles:R: remove duplicate row entries in gridExtra table - rUse Uri data as href tag - jqueryISIN function not working for dates - pythonNSURLSession vs Background Fetch - iosPossible implementation of Prime Counting - performanceClose and open another div after the loop will increase by 3 each time - javascriptHow to convert hex to string or text in php - stringHow to remove the space inside the tag? - xmlhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/954855/adding-columns-to-a-data-table&usg=ALkJrhiuEcI-kQ3GxrWHz090rSyIwhqzkwPreventing multiple instances of a GTK application - cAll Articles