Thread: Newbie question

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Sweden
    Posts
    384
    Rep Power
    15
    Hi all!

    I would like to open a html file in my PHP script and save it as an variable, but I canīt figure out how to do it...
    Does anybody have the solution?

    Thanks in advance,
    Christoffer
    SWEDEN
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    15
    <?php
    // get a web page into an array and print it out
    $fcontents = file( 'http://www.fastband.net/~sglane/index.html' );
    while ( list( $line_num, $line ) = each( $fcontents ) ) { echo "<b>Line $line_num:</b> " . htmlspecialchars( $line ) . "<br>n"; }
    // get a web page into a string
    $fcontents = join( '', file( 'http://www.fastband.net/~sglane/index.html' ) );
    ?>

    Try this.

    ------------------
    -Gabe
    "Save trees, eat beaver."
    "y!php3++?"

Similar Threads

  1. Newbie table creation question
    By andy collins in forum PostgreSQL Help
    Replies: 3
    Last Post: January 23rd, 2004, 02:27 PM
  2. Java Newbie question
    By S0l0 in forum Java Help
    Replies: 5
    Last Post: January 12th, 2004, 03:38 PM
  3. ok super newbie question
    By SCerviche in forum Flash Help
    Replies: 5
    Last Post: January 11th, 2004, 02:29 PM
  4. newbie question
    By lottidah in forum .Net Development
    Replies: 2
    Last Post: December 8th, 2003, 02:11 PM
  5. newbie question on install
    By iwanaa in forum PHP Development
    Replies: 4
    Last Post: November 25th, 2003, 08:02 PM

IMN logo majestic logo threadwatch logo seochat tools logo