php-general | 2001072
Date: 07/31/01
- Next message: Richard Lynch: "[PHP] Re: splitting a string in half"
- Previous message: Richard Lynch: "[PHP] Re: "Call to a member function on a non-object" error!"
- In reply to: Paul Uttley: "[PHP] Reading from remote files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> 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>
- Next message: Richard Lynch: "[PHP] Re: splitting a string in half"
- Previous message: Richard Lynch: "[PHP] Re: "Call to a member function on a non-object" error!"
- In reply to: Paul Uttley: "[PHP] Reading from remote files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

