Supprimer un message
cauet
Bon ben au cas ou quelqu'un voudrait sortir la même chose ... voici un code qui fonctionne ...
function generate_structured_communication($transactionID) {
$base = (float) $transactionID;
$control = $base - floor($base / 97) * 97;
if ($control == 0) {
$control = 97;
}
$base_s = (string) $base;
$control_s = (string) $control;
if ($control < 10) {
$control_s = "0" . $control_s;
}
$base_len = strlen($base_s);
$count = 10 - $base_len;
for ($i=0; $i < $count; $i++) {
$base_s = "0" . $base_s;
}
$com = $base_s . $control_s;
return substr($com, 0, 3) . "/" . substr($com, 3, 4) . "/" . substr($com, 7, 5);
}
function generate_structured_communication($transactionID) {
$base = (float) $transactionID;
$control = $base - floor($base / 97) * 97;
if ($control == 0) {
$control = 97;
}
$base_s = (string) $base;
$control_s = (string) $control;
if ($control < 10) {
$control_s = "0" . $control_s;
}
$base_len = strlen($base_s);
$count = 10 - $base_len;
for ($i=0; $i < $count; $i++) {
$base_s = "0" . $base_s;
}
$com = $base_s . $control_s;
return substr($com, 0, 3) . "/" . substr($com, 3, 4) . "/" . substr($com, 7, 5);
}
Merci braimmain!
J'allais justement devoir faire ca das les jours à venir..