$val) $myarray[$key ] = str_replace("\n","",str_replace("\r","",$val)); $index = array_search("#",$myarray); if($index === false) //note === with typecheck echo "string not found"; else { echo "string found at index : $index in array
line is
"; echo $myarray[$index]; } ?>