0

I have two issues in this scenario-

  1. When I am reading content from doc then it showing me unwanted character like diamond question mark?

  2. I want to know key of value "Q1" by using array_search(),How I can know the key(8) of value Q1 in $lines array?

    if($_POST['Upload'] == 'Upload')
    {
      $myfile = $_FILES["filename"]["tmp_name"];
    
     if(($fh = fopen($myfile,'r')) !== false )
     {
        $line = fread($fh, filesize($myfile));
    
        $lines = explode(chr(0x0D),$line);
    
        $ans = '';
        echo '<pre>';
        print_r($lines);
    
        var_dump($lines[8]);
        var_dump(array_search($lines[9],$lines));
        var_dump(array_search("Q1.",$lines)); 
    }
    

    } enter image description here

0 Answers0