2
0
forked from Wavyzz/dolibarr

Ajout possibilit d'enregistrer des modles d'exports afin de ne pas les selectionner chaque fois, fonctionnalit oprationnel mais reste la fignoler !!

This commit is contained in:
Regis Houssin
2007-03-23 17:58:06 +00:00
parent 83b82453a5
commit 9b966925e8
7 changed files with 283 additions and 5 deletions

View File

@@ -2329,4 +2329,32 @@ function clean_html($StringHtml)
return $CleanString;
}
/**
\brief Convertir de l'h<>xad<61>cimal en binaire
\param string bin
\return string x
*/
function binhex($bin, $pad=false, $upper=false){
$last = strlen($bin)-1;
for($i=0; $i<=$last; $i++){ $x += $bin[$last-$i] * pow(2,$i); }
$x = dechex($x);
if($pad){ while(strlen($x) < intval(strlen($bin))/4){ $x = "0$x"; } }
if($upper){ $x = strtoupper($x); }
return $x;
}
/**
\brief Convertir de l'h<>xad<61>cimal en binaire
\param string hexa
\return string bin
*/
function hexbin($hexa){
$bin='';
for($i=0;$i<strlen($hexa);$i++)
{
$bin.=str_pad(decbin(hexdec($hexa{$i})),4,'0',STR_PAD_LEFT);
}
return $bin;
}
?>