Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Nikola Posa:
Community-driven PHP 8 Wish List
Sep 24, 2018 @ 14:08:01

Nikola Posa has a new post to his site sharing what he calls a "community-driven PHP 8 wishlist" as gathered from replies to a tweet he posted back in July 2018.

It's been over two months since I started a research on Twitter about the things that developers would like to be added or improved in the next major PHP release. [...] It had a surprisingly long reach, inspiring developers, prominent experts, community representatives to express their opinion through more than a hundred responses.

It would be a waste to leave such a valuable data in the form of a raw and fuzzy Twitter thread, so I finally found some time to turn it into something more useful.

In the post he shares the results in a spreadsheet, with the top three being: arrow functions, multi-threading and method overloading. Other interesting features also made an appearance pretty high on the list including boot-time preloading, scalar objects, native async and built-in request/response objects. Check out the post for the complete list and how it was processed into its final form.

tagged: community wishlist php8 spreadsheet results tweet

Link: https://blog.nikolaposa.in.rs/2018/09/23/community-driven-php8-wish-list/

NetTuts.com:
How to Generate a Complete Excel Spreadsheet From MySQL
Nov 23, 2011 @ 23:52:54

On NetTuts there's a new tutorial showing how to take data from a MySQL database and translate it into a usable Excel file with the help of some simple PHP.

A CSV (Comma Separated Value) file is usually sufficient for exporting MySQL data as an Excel Spreadsheet. These CSV files are data only though. A real Excel spreadsheet has formatting, formulas and perhaps even graphics - the difference between a simple method of data transfer and a professional report. This tutorial shows how to use open source PHP components to create "real" Excel spreadsheets from MySQL SELECT statements.

With the help of the PHPExcel tool, making Excel-formatted files is a simple process. They show how to label columns, pull data out with a "quick and dirty" SQL statement, formatting the results to something a bit more clean and iterate through the pages of data to push them into the spreadsheet (including formulas). You can download the full source to get everything in one shot.

tagged: excel spreadsheet tutorial phpexcel mysql database

Link:

Pablo Viquez's Blog:
Export Excel Spreadsheets using Zend Framework
Aug 25, 2009 @ 12:57:30

New on his blog today Pablo Viquez has this post looking at code that will let your Zend Framework applications export to Microsoft Excel spreadsheets (via the Spreadsheet Excel Writer PEAR component).

Last week, I had to allow the user to export a given report into an MS Excel file format. The application uses Zend Framework 1.9.1 and so far ZF does not support for "Office" formats, so after searching for a nice implementation, I found a PEAR module called Spreadsheet Excel Writter, which looked pretty good, it had very good documentation and the code was clean and well structured so I wanted I give it a shot.

He lays out the structure of the sample application and, using a context switch on the request, he creates a controller that responds to the "/report" by calling a special model/view combination that uses the PEAR package to push out the custom "report.xls" file.

tagged: zendframework pear excel spreadsheet

Link:

Juozas Kaziukenas' Blog:
Creating Excel documents on the fly
Feb 17, 2009 @ 18:55:45

Juozas Kaziukenas has a new blog post that looks at creating Excel documents on the fly with the Spreadsheet_Excel_Writer PEAR package.

In one of my projects, we need to send emails to our suppliers with new orders as Excel spreadsheets. We used to do it by hand, but when you have 10 suppliers and you make 200 products orders per week, after some time you are just tired of creating Excel spreadsheets, mailing them and so on. So, my task was to implement automatic spreadsheets creation with PHP.

His example creates a basic file with a set of "Items", some formatting and a set of code/title items to fill out each row. The end result can then be packaged up and sent out as a complete Excel XLS file.

tagged: excel document create tutorial spreadsheelexcelwriter pear package spreadsheet

Link:

Maarten Balliauw's Blog:
Saving a PHPExcel spreadsheet to Google Documents
Feb 03, 2009 @ 18:58:56

Maarten Balliauw has written up a guide to saving the output of your PHPExcel applications out to the Documents service that Google offers.

As you may know, PHPExcel is built using an extensible model, supporting different input and output formats. The PHPExcel core class library features a spreadsheet engine, which is supported by IReader and IWriter instances used for reading and writing a spreadsheet to/from a file. Currently, PHPExcel supports writers for Excel2007, Excel5 (Excel 97+), CSV, HTML and PDF. Wouldnt it be nice if we could use PHPExcel to store a spreadsheet on Google Documents? Let’s combine some technologies.

The two technologies in question are a standard install of the PHPExcel library and the Zend Framework (with its Zend_Gdata component). Using the component, a save() method is created and hooked into the IWriter interface of PHPExcel. When this save method is called, the Zend_Gdata component connects to the Documents service and uploads the resulting information for the account you supply.

tagged: tutorial save phpexcel extensible document google spreadsheet zendframework zendgdata

Link:

Zend Developer Zone:
Reading and Writing Spreadsheets with PHP
Apr 03, 2008 @ 13:49:19

On the Zend Developer Zone, Vikram Vaswani has posted a tutorial that shows hos to "break the language barrier" between PHP and Microsoft's Excel to allow for the reading and writing of spreadsheet data directly from one to the other.

When it comes to playing nice with data in different formats, PHP's pedigree is hard to beat. Not only does the language make it a breeze to deal with SQL result sets and XML files, but it comes with extensions to deal with formats as diverse as Ogg/Vorbis audio files, ZIP archives and EXIF headers. So it should come as no surprise that PHP can also read and write Microsoft Excel spreadsheets, albeit with a little help from PEAR.

After grabbing the different parts needed (the PHP-ExcelReader package and the Spreadsheet_Excel_Writer PEAR package, he shows how to create a simple spreadsheet with just numeric information in it. For something a bit more interesting, he goes the other way and shows spreadsheet data as an HTML table.

Other examples included as well are things like: pushing spreadsheet data into a database, working with formulas and styling it to your liking.

tagged: spreadsheet excel pear package phpexcelreader writer tutorial

Link:

Developer Tutorials Blog:
5 PEAR gems: free php scripts that will help you code quicker
Mar 19, 2008 @ 14:37:29

Akash Mehta has pointed out five "PEAR gems" that can help you get your code up and running faster - some helpful bits of code to help you deal with some common issues.

Sifting through the repository is also a challenge; a basic category system is in place, but it’s hard to tell what you want when you don't know what's available. Here are some gems from the PEAR repository that you could really find useful.

The five that made his list are:

tagged: pear repository package akisment http archive spreadsheet excel xml

Link:

Dotvoid.com:
Generating Excel files with PHP
Jul 10, 2007 @ 12:46:47

Danne Lundqvist has posted about the process he went through when developing a solution to create Excel files in PHP:

I'm on this project at work where we need to create an excel file and send it via email or ftp to a recipient. The normal answer to this is to create a comma separated file and name it .xls and excel will work it out. However, that only works if you open it directly through an http request and are able to set the http headers correctly.

To get around these limitations, he found two solutions (thanks Google!) in PEAR's Spreadsheet_Excel_Writer and an MS-Excel Stream Handler class. He includes code that gives an example of another solution, one that packs data into a binary string and returns it as a part of the Excel document.

tagged: excel file pear spreadsheet msexcel stream handler excel file pear spreadsheet msexcel stream handler

Link:

Dotvoid.com:
Generating Excel files with PHP
Jul 10, 2007 @ 12:46:47

Danne Lundqvist has posted about the process he went through when developing a solution to create Excel files in PHP:

I'm on this project at work where we need to create an excel file and send it via email or ftp to a recipient. The normal answer to this is to create a comma separated file and name it .xls and excel will work it out. However, that only works if you open it directly through an http request and are able to set the http headers correctly.

To get around these limitations, he found two solutions (thanks Google!) in PEAR's Spreadsheet_Excel_Writer and an MS-Excel Stream Handler class. He includes code that gives an example of another solution, one that packs data into a binary string and returns it as a part of the Excel document.

tagged: excel file pear spreadsheet msexcel stream handler excel file pear spreadsheet msexcel stream handler

Link:


Trending Topics: