zeeshan_haider000 Posted March 21, 2009 Share Posted March 21, 2009 Hi, I am getting this error: Notice: Undefined offset: 2 in /homepages/46/d272861742/htdocs/i.com/sitev2/includes/functions.php on line 327 Notice: Undefined offset: 1 in /homepages/46/d272861742/htdocs/i.com/sitev2/includes/functions.php on line 327 And here is the code: <?php $cachefile = $files; $cache1 = mysql_num_rows($result); if (file_exists($cachefile)){ $line = file($cachefile); $key = 0; list( $s1, $cache, $s2) = split('\|\|', $line[$key]); //THIS IS LINE 327 ?> How do i get rid of this notice ( and btw i am trying to get the first line of the file and then destroy the array)? Link to comment https://forums.phpfreaks.com/topic/150421-solved-undefined-offset/ Share on other sites More sharing options...
GingerRobot Posted March 21, 2009 Share Posted March 21, 2009 Evidently the string \|\| doesn't occur in the first line of that file at all. Should it? Link to comment https://forums.phpfreaks.com/topic/150421-solved-undefined-offset/#findComment-790009 Share on other sites More sharing options...
bluejay002 Posted March 21, 2009 Share Posted March 21, 2009 Also... it may possibly means that on the list part, not all of them receives a value after the splitting. More like the splitted string does not supply to the three required variables in the list part. Link to comment https://forums.phpfreaks.com/topic/150421-solved-undefined-offset/#findComment-790014 Share on other sites More sharing options...
zeeshan_haider000 Posted March 21, 2009 Author Share Posted March 21, 2009 Evidently the string \|\| doesn't occur in the first line of that file at all. Should it? It did occur but instead of double pipes ||value||, i only had one pipe there |value|...i'd forgotten to change the other code lol..thanks Link to comment https://forums.phpfreaks.com/topic/150421-solved-undefined-offset/#findComment-790021 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.