On Tuesday 14 November 2006 12:32 pm, Nelly Yusupova wrote: > Hello Everyone, > > I wrote an application in PHP to export all of the data into a CSV > document so my client can view the data. Everything works great except > the Zip Code fields. For the zip codes that start with a zero, the zero > is removed. > > I know this is done by Excel because it is treating the contents of the > cell as a number. > > Is there any way to tell excel to treat the content of the cell as text > automatically?
Put a single quote in front of the value. This value: '01234 will be seen by Excel as the text string "01234" rather than the numeric value 1234. (Another solution: the user can also, when importing into Excel, set that field as "Text" rather than "General".) Michael Sims _______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php
