cowboysdude Posted November 10, 2009 Share Posted November 10, 2009 This is what I"m using and it works great until I add $n_time to the list variable set then I get this error... "Undefined offset: etc..etc.." Take out the $n_time variable and the error goes away.. suggestions? $lines = file('modules/mod_norven/edit/files.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach($lines as $n_line) { list($n_id, $n_vid, $n_pic, $n_title) = explode('-', $n_line); echo '<li><a href="'.$n_url.'/'.$n_path.'/'.$n_vid.'" id="mb'. $n_id.'" class="mb" ><IMG class=Tips4 title="'.$n_time.'::'.$n_title.'" src="'.$n_url.'/modules/mod_norven/images/vidimg/'. $n_pic .'" border="0" width="60" Height="60" ></a></li>'; } ?> Thanks in advance!!! Link to comment https://forums.phpfreaks.com/topic/180928-solved-php-list-question/ Share on other sites More sharing options...
Alex Posted November 10, 2009 Share Posted November 10, 2009 You're not defining $n_time within your list: list($n_id, $n_vid, $n_pic, $n_title) = explode('-', $n_line); Add it if you know how, or show us the structure of $n_line. Link to comment https://forums.phpfreaks.com/topic/180928-solved-php-list-question/#findComment-954509 Share on other sites More sharing options...
cowboysdude Posted November 10, 2009 Author Share Posted November 10, 2009 You're not defining $n_time within your list: list($n_id, $n_vid, $n_pic, $n_title) = explode('-', $n_line); Add it if you know how, or show us the structure of $n_line. It's above as this.. list($n_id, $n_vid, $n_pic, $n_title) = explode('-', $n_line); except I would have added this... list($n_id, $n_vid, $n_pic, $n_title, $n_time) = explode('-', $n_line); and when I do that is when I get the offset error.. I pasted the entire code above... that is all that is between the <? and ?> lines... Link to comment https://forums.phpfreaks.com/topic/180928-solved-php-list-question/#findComment-954517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.