NYCPHP Meetup

NYPHP.org

[nycphp-talk] Mantis/Subversion integration

Greg Rundlett greg.rundlett at gmail.com
Thu Sep 15 15:53:07 EDT 2005


On 9/15/05, Greg Rundlett <greg.rundlett at gmail.com> wrote:
> 
> quick and easy
> 
> *function* openUrl($url) {
>        *// Fake the browser type*
>        *// ini_set('user_agent','MSIE 4\.0b2;');*
>     $handle = fopen($url
> , "rb");
>     $contents = '';
>     if($handle) {
>         while (!feof(
> $handle)) {
>             $contents .= fread($handle
> , 8192);
>         }
>         fclose($handle);       
>     }
>     else {
>         $contents = 'Error opening $url' . $url
> ;
>     }
>     return $contents;
> } 
> 
> 
> 
> print $contents = openUrl('http://www.google.com')<http://www.google.com%27%29>
> ;
> 
> and run that from the bat as php.exe -f myUrlGetter.php url=
http://www.foo.com

of course then you'd perhaps want to add in Console/GetOpt.php (from PEAR) 
to parse the command-line args
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20050915/f8653537/attachment.html>


More information about the talk mailing list