- preg_match: documentation ( source)
<?php
$silence = 0;
$fxoPattern2DisconnectCount = 0;
function cfgIsNumeric( $value )
{
return ( ($value !== '') && preg_match("/^[-+]?[0-9]+$/", $value) > 0 );
}
function cfgIsValidRangeOrZero( $value, $min, $max) {
return ( ($value !== '') && cfgIsNumeric($value) && ((int)$value == 0 || ((int)$value >= $min && (int)$value <= $max)) );
}
if( !cfgIsValidRangeOrZero($silence, 50, 750) ||
($fxoPattern2DisconnectCount > 0 && $silence == 0 ) )
echo "!";
else echo "?";