title: how to parse html tags when writing to a excel file in PHP
body: <p>I have 2 questions </p>
  
  <p>1) I want to fetch color code used inside span tag in the text </p>
  
  <p>2) I want to parse html tags when writing to excel file to apply the color code used </p>
  
  <p>example value from database as shown below</p>
  
  <pre><code>&lt;p&gt;&lt;strong&gt; the test content goes here&lt;span style="color: #800000;"&gt;It will be 
  displayed&lt;/span&gt; &lt;/strong&gt;&lt;/p&gt;
  </code></pre>
  
  <p>i have the above text from a textarea is present in a variable so my requirement is to use any php excel library to write in a excel file so the formatting of text remains same like font color and bold </p>
  
  <p>the approach i tried using spreadsheet_excel_writer as below</p>
  
  <pre><code>`$workbook = new Spreadsheet_Excel_Writer();
  $workbook-&gt;SetVersion(8);
  $format_title =&amp; $workbook-&gt;addFormat();
  for ($j = 0; $j &lt; count($all_values); $j++)
  {
      for ($c = 0; $c &lt; 24; $c++)
      {
          $format = $workbook-&gt;addFormat();
          $format-&gt;setColor('blue');
  
          if($c==7)
          $worksheet-&gt;write($i, $c,$all_values[$j][$c],$format);
          $worksheet-&gt;write($i, $c,$all_values[$j][$c]);
      }
      $i++;
  }`
  </code></pre>
  
  <p>But this applies to the whole cell </p>
  
  <p>I even tried to use PHPEXCEL but same in that too as it applies to the whole cell.</p>
  
  <p>Here's <a href="http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.spreadsheet-excel-writer-format.setcolor.php" rel="nofollow">a link</a> which i found to Set color in spreadsheet_excel_writer. </p>
  
  <p>please help me with links and code solution is greatly appreciated </p>