In your example, i took this:
Array ( [calldate] => 2012-08-07 12:39:35 [dst] => 9425250 [billsec] => 34 [dstchannel] => DAHDI/2-1 [lastdata] => DAHDI/g2/425250,300, )
[1] => Array ( [id] => 5 [name] => l2 [prefix] => 9 [rate] => 2.0 [rate_offset] => 0.01 [trunk] => DAHDI/g2 [estado] => activo [fecha_creacion] => 2012-07-25 07:50:45 [fecha_cierre] => [hided_digits] => 2 [idParent] => 0 )
I made a small php script and took only the test from original code (index.php in rx_check_out folder):
| Code: |
if (substr($value_cdr['dst'],0,strlen($arrRate[$Scan_Rate]['prefix'])) == $arrRate[$Scan_Rate]['prefix'] && substr($value_cdr['lastdata'],0,strlen($arrRate[$Scan_Rate]['trunk'])) == $arrRate[$Scan_Rate]['trunk']){
.../...
}
|
So...
<?PHP
if (substr('9425250',0,strlen('9')) == '9' &&
substr('DAHDI/g2/425250,300,',0,strlen('DAHDI/g2')) == 'DAHDI/g2')
{
echo "Ok";
}
?>
Gives me this result:
Ok
So, the test is good (for me)..
I don't understand.