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!!! Quote 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. Quote 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... Quote Link to comment https://forums.phpfreaks.com/topic/180928-solved-php-list-question/#findComment-954517 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.