SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Sorry. I tried searching in the manual of php.net but couldn't find anything that could do what i want.

    Hmm..okie..I have a file with many lines..how do i assign each line with a variable?

    like $variable[0], $variable[1] etc....

    thanks
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2000
    Location
    Allentown PA
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $array = file("/path/to.file");

    http://www.php.net/manual/function.file.php

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Cool. Thanks..
    So to access the different lines..I use:

    $array[0] - for the first line and so on?
    Coz php.net only showed the example to print out the entire array..thanks

    -- Okay..thanks! I got it..yup...
    <Edited by lynlimz on 11-28-2000 at 10:02 AM>
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


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
  •