public function get_rows($file_path, $start = 0, $length = 0)
{
$handle = fopen($file_path, 'r');
$rows = array();
$i = 0;
while ( !feof($handle) )
{
$row = fgets($handle);
if ( $i >= $start && $i < $start + $length )
{
$row = trim($row);
if ( strlen($row) )
{
$cells = explode("\t", iconv('windows-1251', 'utf-8', $row));
foreach ( $cells as $n => $cell )
if ( substr($cell, 0, 1) == '"' && substr($cell, -1) == '"' )
$cells[$n] = str_replace('""', '"', substr($cell, 1, strlen($cell) - 2));
$rows[] = $cells;
}
}
$i++;
}
fclose($handle);
return $rows;
}
function a2p($array)
{
return implode('/', $array);
}
function p2a($path)
{
return explode('/', $path);
}
function ap(&$input, $path = null, $set_value = null)
{
if ( !is_null($path) )
{
if ( $path )
$path = p2a($path);
if ( !is_null($set_value) )
{
if ( $path )
eval('$input["' . implode('"]["', $path) . '"] = $set_value;');
else
$input = $set_value;
return $input;
}
else
{
if ( $path )
eval('$value = isset($input["' . implode('"]["', $path) . '"]) ? $input["' . implode('"]["', $path) . '"] : null;');
else
$value = $input;
return $value;
}
}
else
{
return $input;
}
}
$path = array(1,8,0);
$arArray = array(1 => array(8 => array(0 => 123)));
print ap($arArray, a2p($path));
if ( (new lk_bans())->checkBanMoney() )