SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Import and display text in PHP

    I would like to know how to display text in PHP from a csv text file or xml file - which ever is easier. I need to be able to display the text in a table.

  2. #2
    SitePoint Addict
    Join Date
    Mar 2005
    Location
    India
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    * Open the file using fopen().
    * Read lines of the file using fgets().
    * Explode the comma seperated string(line) with explode().
    * Use foreach and display the columns.

    To know more about these functions visit http://www.php.net.

  3. #3
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks. but are you able to guide me to a working example?

  4. #4
    SitePoint Member
    Join Date
    Nov 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy

    anyone??

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    New York City
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your best bet would be to go to that php.net site viv5 linked to above, and learn how each of those commands works, then you'll know what to do. If you're looking for a script already written, try a Google search or a script library site like Hotscripts. Have you also search Sitepoint? Lots of articles here, too. Then you can come back here with specific questions if you want specific answers.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •