I am working with codeigniter. I cannot find any error with the code below, yet this line if($split['1'] == $param)
throws an error "Severity: Notice Message: Undefined offset: 1". I checked echoing the value which outputs the exact value. Something seems to go wrong inside the if condition. Any help is greatly appreciated. Thanks
$myfile = fopen("newfile.txt", "r") or die("Unable to open file!");
if ($myfile) {
while(!feof($myfile)) {
$split = explode(',',fgets($myfile),2);
//echo $split['1'];
if($split['1'] == $param){
echo $split['0'];
}
}
}