Replace String in existing Excel document

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Replace String in existing Excel document

Post by amir »

I need a simple php script that would allow me to replace a string with another in an existing .xls file. Fo example, the first cell contains the word "yellow". I should be able to replace "yellow" with the string "red" without corrupting the .xls file. If "yellow" was in the second cell, that the second cell would be the one that gets modified.

TIA!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Get the Excel reader from PEAR. It may support what you want. Otherwise, you're going to need to use COM or have to do it another way.
Post Reply