CheckParam() avec paramètres variables

This commit is contained in:
Clecle 2015-11-17 19:02:28 +01:00
parent c0f5dfa5dc
commit 518280333a
1 changed files with 35 additions and 0 deletions

View File

@ -202,4 +202,39 @@
}
/*function checkParamBIS( ...$checkIt ) {
// checkIt[] Tableau | checkIT[][] Types des Variables | checkIt[][][] Formats des variables | checkIt[][][][] Valeur des varialbes
$checker = false;
for( $i = 0; $i < func_num_args(); $i++) {
for( $j = 0; $j < sizeof( $checkIt[$i] ); $j++) {
switch ($checkIt[$i][$j]) {
case 'string': if( is_string( $checkIt[$i][$j][$j][$j] ) )
$checker = is_string( $checkIt[$i][$j][$j][$j] ) && preg_match( $checkIt[$i][$j][$j], (String) $checkIt[$i][$j][$j][$j] );
break;
case 'int': if( is_string( $checkIt[$i][$j][$j][$j]) )
$checker = is_int( $checkIt[$i][$j][$j][$j] ) && preg_match( $checkIt[$i][$j][$j], (String) $checkIt[$i][$j][$j][$j] );
break;
case 'numeric': if( is_string( $checkIt[$i][$j][$j][$j]]) )
$checker = is_numeric( $checkIt[$i][$j][$j][$j] ) && preg_match( $checkIt[$i][$j][$j], (String) $checkIt[$i][$j][$j][$j] );
break;
case 'array': if( is_numeric( $checkIt[$i][$j][$j][$j]) )
$checker = is_array( $checkIt[$i][$j][$j][$j] ) && count( $checkIt[$i][$j][$j] ) > 0;
break;
}
}
}
return $checker;
}*/
?>