I can print a web page in xl format (see the code below). That is not my question?
Code: Select all
<html>
<head>
<?php
$useragent = $_SERVER['HTTP_USER_AGENT'];
if (preg_match('|MSIE ([0-9].[0-9]{1,2})|',$useragent)) {
$browser = 'IE';
} elseif (preg_match( '|Opera ([0-9].[0-9]{1,2})|',$useragent)) {
$browser = 'Opera';
} elseif(preg_match('|Firefox/([0-9\.]+)|',$useragent)) {
$browser = 'Firefox';
} elseif(preg_match('|Safari/([0-9\.]+)|',$useragent)) {
$browser = 'Safari';
} else {
// browser not recognized!
$browser_version = 0;
$browser= 'other';
}
switch ($browser){
case 'IE':
header('Content-Type: application/vnd.ms-excel'); //IE and Opera
break;
case 'Opera':
header('Content-Type: application/vnd.ms-excel'); //IE and Opera
break;
default:
header('Content-Type: application/x-msexcel'); // Other browsers
} // switch ($browser)
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
?>
<title>Print Log File</title>
</head>
<body>
<table width="300" border="1" cellspacing="3" cellpadding="3">
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
</tr>
<tr>
<td>Alex</td>
<td align="center"><p>22</p> </td>
</tr>
<tr>
<td>Tony</td>
<td align="center">30</td>
</tr>
</table>
</body>
</html>I want to know also if there is an xl API that allows me to access each cell of an xl sheet?
Thanks.