Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 14th, 2005, 04:14 AM
Registered User
 
Join Date: Mar 2005
Location: Ballarat, Victoria, Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Html > csv format

Hi
I would like to know if there is a tutorial on creating a PHP script to read and extract data from a html file (data set out in database table format) to convert it to csv or even sql for MySQL database.

Thanks. Pat

Reply With Quote
  #2 (permalink)  
Old March 27th, 2005, 10:01 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Depends on the structure of the HTML file. In which case, if I could answer that the HTML file was well-formed and could pass for XML I'd look at tutorials for reading and parsing XML, which many methods exist. There is also the DOM extension to PHP, and it might be just as easy to parse the data using that extension. Start with the PHP manual:

http://www.php.net/manual/en/ref.dom.php
http://www.php.net/manual/en/ref.simplexml.php
http://www.php.net/manual/en/function.fputcsv.php

Then you can search Google for examples of these in action.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
Reply With Quote
  #3 (permalink)  
Old March 27th, 2005, 06:39 PM
Registered User
 
Join Date: Mar 2005
Location: Ballarat, Victoria, Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Rich
Yes the files are well formed. Not sure about the xml but the html tags are the same and don't change from week to week.

Will take your advice and read up on the suggested links

Thanks Pat

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change excel into csv format Ivanchan Excel VBA 4 July 5th, 2007 02:02 AM
Exporting Report to CSV format. chakravarthy_vr Reporting Services 4 March 20th, 2006 07:27 AM
Achitecture ? SQL -> XML -> ASP -> PDF or HTML Frm jstrong Classic ASP XML 0 July 9th, 2005 01:18 PM
HELP: XSL -> HTML <select selected=true> jedbartlett XSLT 4 October 7th, 2004 11:16 PM
exporting to csv format dazednconfused Beginning PHP 1 July 11th, 2003 03:31 PM



All times are GMT -4. The time now is 11:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.