Détaille tes propos en mettant en exemple le code, on est pas devin non plus...par contre ce que je ne comprend pas sur la fonction qui remplace le 0 par un Nc
Détaille tes propos en mettant en exemple le code, on est pas devin non plus...par contre ce que je ne comprend pas sur la fonction qui remplace le 0 par un Nc
Code : Tout sélectionner
function Fix_Location($variable){
$variable = (int)$variable;
if($variable > 0 ){
return $variable ;
}else{
return '10' ;
}
}Code : Tout sélectionner
function Fix_Location($variable){
$variable = (int)$variable;
if($variable > 0 ){
return $variable ;
}else{
return 'Location' ;
}
}<?php
function Fix_Location($variable){
$variable = (int)$variable;
if($variable > 0 ){
return $variable ;
}else{
return 'Location' ;
}
}
echo '->'.Fix_Location(10).'<br />';
echo'->'. Fix_Location(0).'<br />';
echo'->'. Fix_Location('').'<br />';
echo'->'. Fix_Location(NULL);
?>
Il me répond:<?php
function Fix_Location($variable){
$variable = (int)$variable;
if($variable > 0 ){
$VarRetournee = $variable ;
}else{
$VarRetournee = 'Location' ;
}
return $VarRetournee ;
}
echo '->'.Fix_Location(10).'<br />';
echo'->'. Fix_Location(0);
?>