#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    I know how to load a file into a script, I was just wondering how to take this information, which is from a text file, and put the text in there into an array.
    for example the text string is this "netprofit 2.3% schools 4.5%" I want to be able to break this apart and list the values into a table. I want to open the file, and be able to list the values, 2.3%, and 4.5% from a array.
    Do I need to use the explode function to do this?

    If someone would help me out I would be very greatful. Thanks in advance.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    61
    Rep Power
    14
    well, first of all, you would use file() to get the file, which puts each line of the file in a new element of an array. After that, you could use explode() to divide each part of a line into array elements. Look in the php.net manual for specific use.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    0
    Rep Power
    0
    Thanks, that file() to put it into an array is exactly what I needed.

IMN logo majestic logo threadwatch logo seochat tools logo