Re: parse html code
| From: | Khalid El-Kary | Date: | Fri, 27 Sep 2002 05:42:47 +0000 |
| Subject: | Re: parse html code | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-117820@lists.php.net to get a copy of this message | ||
hi,
you have two things to do here, first obtain the file, second get urls inside it ...
about the first you can get the file so easily using the functions fopen, fread and fclose
int fopen ( string filename, string mode [, int use_include_path [, resource zcontext]] )
//for example (this will open for writing only)
$file=fopen("http://www.anydomain.com/index.html","w");
//follow the other php file system functions to read the file and obtain a string from it.
http://it3.php.net/manual/en/ref.filesystem.php
about getting URLs from the file this could be done through string functions (by applying them on the returned string)
refer to functions strpos, substr, substr_count, strlen in the php manual
http://it3.php.net/manual/en/ref.strings.php
hopefully this will help
yours,
khalid
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com