Thread: cURL
View Single Post
Old 10-22-2007, 09:51 PM   #4 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

should do:
PHP Code:
function file_get_content$url )
{
    for( 
$i 1$c <= $this->conf['tries']; $c++ )
    {
        
$ch curl_init($url);

        
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
        
$file curl_exec($ch);//Returns file contents string, FALSE on failure
        
        
curl_close($ch);

        if(
$file)
        {
            return array( 
=> TRUE=> $file );
            break;
        }
    }
    return array( 
=> FALSE=> '' );

I havent tested it, but theoreticly it should work.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote