Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001072

[PHP] Re: Reading from remote files From: Richard Lynch (ceo <email protected>)
Date: 07/31/01

> I am trying to read in a nav bar from a remote web page into my web page.
> There is a comment at the start <!-- 1st Column start --> and one at the
end
> <!-- 1st Column end -->, and i want to be able to read in everything
between
> these two comments.

How sure are you that these comments won't change...?

<?php
    $remote = file("http://whatever.com/navbar.htm") or die("Could not snag
remote web page.");
    $html = implode('', $remote);
    $parts = explode('<!-- 1st Column start -->', $html);
    $goodpart = $parts[1];
    $parts = explode('<!-- 1st Column end -->', $goodpart);
    $navbar = $parts[0];
    echo $navbar;
?>

--
WARNING richard <email protected> address is an endangered species -- Use
ceo <email protected>
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>