Skip to content
Advertisement

Hex Decode using php

I would like to know where I can find a function in php that performs the decoding of this type of encoding in hex. http://ddecode.com/hexdecoder/?results=61292a2c593c3b93bf8d1e6d10c94e05 Using function in PHP.

Advertisement

Answer

You don’t need a decoder. PHP recognizes hex escapes in its string literals similarly to JavaScript. So just put the strings into a PHP script and print them.

$encoded = ["x76x69x64x65x6Fx43x6Fx6Ex74x61x69x6Ex65x72","x41x6Ex56x2Dx30x34"];
var_dump($encoded);

prints:

array(2) {
  [0]=>
  string(14) "videoContainer"
  [1]=>
  string(6) "AnV-04"
}
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement