title: Remove HTML tags when exporting from MYSQL to Excel PHP
body: <p>I"m looking for help related to removing HTML tags from a field in MYSQL database field when exporting to excel.</p>
  
  <p>fore exaple when I export I see </p>
  
  <pre><code>&lt;BR&gt;Testing actions and comments box
  </code></pre>
  
  <p>My Code</p>
  
  <pre><code>$file_ending = "xls";
  //header info for browser
  header("Content-Type: application/xls");    
  header("Content-Disposition: attachment; filename=excel.xls");  
  header("Pragma: no-cache"); 
  header("Expires: 0");
  /*******Start of Formatting for Excel*******/   
  //define separator (defines columns in excel &amp; tabs in word)
  $sep = "\t"; //tabbed character
  //start of printing column names as names of MySQL fields
  for ($i = 0; $i &lt; mysql_num_fields($result); $i++) {
  echo mysql_field_name($result,$i) . "\t";
  }
  print("\n");    
  //end of printing column names  
  //start while loop to get data
      while($row = mysql_fetch_row($result))
      {
          $schema_insert = "";
          for($j=0; $j&lt;mysql_num_fields($result);$j++)
          {
              if(!isset($row[$j]))
                  $schema_insert .= "NULL".$sep;
              elseif ($row[$j] != "")
                  $schema_insert .= "$row[$j]".$sep;
              else
                  $schema_insert .= "".$sep;
          }
          $schema_insert = str_replace($sep."$", "", $schema_insert);
          $schema_insert = preg_replace("/\r\n|\n\r|\n|\r/", " ", $schema_insert);
          $schema_insert .= "\t";
          print(trim($schema_insert));
          print "\n";
      }   
  </code></pre>