I have something that works so just for my curiosity/annoyance...Why does the first work but not the others?
The error is: Undefined index: name
Which tells me the array pair key is not there anymore?
The array is generated by:
Code:
This works:
foreach ($arrFiles as $row) {
$firstRow = $row['name'];
break;
}
This doesn't:
$row = each($arrFiles);
$firstRow = $row['name'];
This doesn't:
$row = array_split($arrFiles, 0, 1);
$firstRow = $row['name'];
Which tells me the array pair key is not there anymore?
The array is generated by:
Code:
while (($file = readdir($dir)) !== false) {
if ( preg_match( "/$fileName\\.[0-9]{10,}/", "$file" ) == 1 ) {
$time = filemtime(HISTORY_PATH.$file);
$arrayRows["$time"] = array( 'name'=>$file,
'size'=>filesize(HISTORY_PATH.$file),
'time'=>$time);
}
}

Comment