Reply to Illegal string offset error in array

Your name:

Reply:


Posted by Johannes Findeisen on 03/27/05 18:20

Hello all,

sorry if this has been asked allready but i didn't find any usefull
information in the web.

Why is this function not working in PHP5?

function getNavigationContent($content_path) {
$i = 0;
$dir = opendir($content_path);
while ($file = readdir ($dir)) {
if ($file != "." && $file != ".." && !in_array($file, explode(',',
$this->arrConf['default_filtered_files']))) {
$arrAvailableContent[$i] = $file;
if(is_dir($content_path . $file)) {
echo $n = 0;
$subdir = opendir($content_path . $file);
while ($subfile = readdir ($subdir)) {
if ($subfile != "." && $subfile != "..") {

/*
* This line does not work in PHP5 cause off an
illegal string offset in an array ERROR
*/
$arrAvailableContent[$i]['submenu'][$n]['file'] =
$subfile;
$n++;
}
}
closedir($subdir);
}
$i++;
}
}
closedir($dir);
return $arrAvailableContent;
}

Can someone help?

Regards

--
# Johannes Findeisen

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация