Well, I think Function and url-checking by regular expression can help you.
Follow code doesn't complete and was not tested. You may add some line or edit this code in your own way.
<?
// REF:I didn't test this code.
function get_url( $src_url ) {
$count_found = 0;
$http_patrn = "http://([0-9a-zA-z./@~?&=_]+)";
// This pattern maybe incorrect or uncomplete. I wrote this down directly now.
$file = fopen( $src_url, "r" );
while( !feof( $file ) ) {
$c = fgetc( $file );
$cont .= $c;
}
fclose($file);
// You can get the source in the way that you like.
if( eregi( $http_patrn, $cont, $reg )) {
$return_url .= $reg[0]."|";
$count_found++;
/*******************/
echo get_url( $reg[0] );
/*******************/
$cont = str_replace( $reg[0], "", $cont);
}
return $return_url;
}
echo get_url( "url_what_you_want" );
?>