kraadde Posted October 4, 2007 Share Posted October 4, 2007 I have following code: function chk( & $var ){ if ( !isset($var) ){ return NULL; }else{ return $var; } } chk($loop); ..... chk($y); $y = 0; while (($loop[$y]) != ''){ error here ?????????? ........ $y++; } ...... Does anybody know how to fix this? I can not figure out why there should be an undefined offset . HELP ME PLEASE! kraadde Link to comment https://forums.phpfreaks.com/topic/71864-notice-undefined-offset-1-in/ Share on other sites More sharing options...
MmmVomit Posted October 4, 2007 Share Posted October 4, 2007 Change this while (($loop[$y]) != ''){ to this while (isset($loop[$y])){ Or you could just use a foreach loop. Link to comment https://forums.phpfreaks.com/topic/71864-notice-undefined-offset-1-in/#findComment-361991 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.