Reputation: 152
I have created CSV file using following code.
<?php
$orders = '<table><tr class="dataTableRow"><td><b>Order ID</b></td><td>Ordered By</td><td>Email</td><td>Ordered On</td><td>Completed On</td><td>Line Items</td><td>Order Total</td>></table>';
$text = "PHP";
$list = array (
array('111', '222', '333'),
array($text),
array($orders)
);
$fp = fopen('file.csv', 'w');
foreach ($list as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
?>
All data in CSV is properly displayed except the HTML content. I want to format contents inside CSV. I need some text in bold and some in italic.
Is there any other way or any solution for this? Please help if somebody knows.
Upvotes: 0
Views: 111
Reputation: 199
No chance, pal. CSV is plain text and you cannot format anything in plain text :-)
Upvotes: 1