array key exists problem with a loop
Posted: Wed Feb 28, 2007 6:30 am
edit// sry i edited the page cause the php code was the wrong one
edit2// sry, this has been solved. thanks =p
that is my function for getting back x number of posts. But i keep getting UNDEFINED OFFSET errors.. any help appreciated
-thanks
edit2// sry, this has been solved. thanks =p
Code: Select all
function read($file,$startNo=0) {
global $xf_root_path,$xf_config_global_extention,$xf_config_postsystem_posts_per_page,$xf_dir_postlogs;
$filename = $file.$xf_config_global_extention;
$fullpath = $xf_root_path.$xf_dir_postlogs.$filename;
$linesx = file($fullpath);
$lines = array_reverse($linesx);
while (list($key,$value) = each($lines)) {
if (($key >= $startNo) && ($key < ($startNo+$xf_config_postsystem_posts_per_page))) {
$output[$key] .= $value;
}
}
return $output;
}-thanks