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)? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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.