Voting

: five plus one?
(Example: nine)

The Note You're Voting On

j_lozinskit at yahoo dot co dot uk
20 years ago
A good option for creating strings with binary data for saving (for example saving an sql statement to a file) into text files or php code is to do the following:

<?php
$field
=bin2hex($field);
$field=chunk_split($field,2,"\\x");
$field= "\\x" . substr($field,0,-2);
?>

this will convert your field (binary or not) into hex and then convert the hex into a string which may be placed in a php file:

FFFFFFFF -> \xFF\xFF\xFF\xFF

<< Back to user notes page

To Top