Codice PHP:
#include <stdio.h>
#include <string.h>
static void StringToHex (const char * theString, const size_t theLen){
int i;
for (i = 0; i < theLen; ++i){
printf ("%X", theString [i]);
}
}
int main (int argc, char * const argv[]){
//
// Compiled and tested with:
// i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
//
// Output: 4369616F
//
const char * aString = "Ciao";
StringToHex (aString, strlen (aString));
return 0;
}