charles07 Posted January 5, 2012 Share Posted January 5, 2012 hi all is there anyway embedding excel or .csv files to the webpage other than the folowing two options . saving it as a webpage . using google docs i used the following code, iam getting the .csv file in the page, but it would be good to have the color formatting, bold, italics... also in the webpage. is it possible? <?php $cnx = fopen("example.csv", "r"); //open example.csv echo("<table style='border:1px solid #ddd;'>"); // echo the table while (!feof ($cnx)) { // while not end of file $buffer = fgets($cnx); // get contents of file (name) as variable $values = explode(",", $buffer); //explode "," between the values within the contents echo "<tr>"; for ( $j = 0; $j < count($values); $j++ ) { // echo("<td style='border:1px solid #ddd;'>$values[$j]</td>"); } echo"</tr>"; }; echo("</table>"); fclose($cnx); //close filename variable ?> Quote Link to comment https://forums.phpfreaks.com/topic/254386-embed-excel-or-csv-in-webpage/ Share on other sites More sharing options...
sKunKbad Posted January 5, 2012 Share Posted January 5, 2012 php has csv functions that would make what you are doing super easy. Quote Link to comment https://forums.phpfreaks.com/topic/254386-embed-excel-or-csv-in-webpage/#findComment-1304401 Share on other sites More sharing options...
charles07 Posted January 5, 2012 Author Share Posted January 5, 2012 i got one http://code.google.com/p/php-excel-reader/ Quote Link to comment https://forums.phpfreaks.com/topic/254386-embed-excel-or-csv-in-webpage/#findComment-1304423 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.