title: How can I do a line break in cell of excel using PHP?
body: <p>Hi I have thw following code:</p>
  
  <pre><code>header('Content-type: application/vnd.ms-excel');
  header("Content-Disposition: attachment; filename=archivo.xls");
  header("Pragma: no-cache");
  header("Expires: 0");
  
  echo "
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta http-equiv="expires" content="0"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table width="100%" border="1" align="center" cellpadding="3" cellspacing="0"&gt;
    &lt;tr&gt;
      &lt;td&gt;Line 1&lt;br&gt;Line 2&lt;/td&gt;
    &lt;/tr&gt; 
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;";
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>&lt;td&gt;Line 1\r\nLine 2&lt;/td&gt;
  &lt;td&gt;Line 1".chr(10) . chr(13)."Line 2&lt;/td&gt;
  </code></pre>
  
  <p>But nothing seems to work, I need to do a line break in a cell, any suggestions are welcomed. I'm using excel 2010.</p>
  
  <p>I already look at this question: <a href="https://stackoverflow.com/questions/7765652/line-break-within-data-for-excel-2003">line break within data for Excel 2003</a> and it didnt work.</p>
  
  <p>It doesnt show error, when I apply <code>&lt;br&gt;</code> it creates a new row, when I use <code>\r\n, \n, or chr(10) . chr(13)</code>, it creates a space.</p>
  
  <p>Thanks!!</p>