Memory Size exhausted error appear
<p>I am using the cURL coding to getting the html of different links. but when i am trying to execute my code this error appear <strong>Allowed memory size of 268435456 bytes exhausted (tried to allocate 75 bytes)</strong> and this error appears after getting 35 html links source code.</p>

<pre>

    function curl_file_get_contents($url)
    {
     $curl = curl_init();
     $userAgent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)';

     curl_setopt($curl,CURLOPT_URL,$url); //The URL to fetch. This can also be set when initializing a session with curl_init().
     curl_setopt($curl,CURLOPT_RETURNTRANSFER,TRUE); //TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.
     curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,5); //The number of seconds to wait while trying to connect.  

     curl_setopt($curl, CURLOPT_USERAGENT, $userAgent); //The contents of the "User-Agent: " header to be used in a HTTP request.
     curl_setopt($curl, CURLOPT_FAILONERROR, TRUE); //To fail silently if the HTTP code returned is greater than or equal to 400.
     curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE); //To follow any "Location: " header that the server sends as part of the HTTP header.
     curl_setopt($curl, CURLOPT_AUTOREFERER, TRUE); //To automatically set the Referer: field in requests where it follows a Location: redirect.
     curl_setopt($curl, CURLOPT_TIMEOUT, 5); //The maximum number of seconds to allow cURL functions to execute.    

     $contents = curl_exec($curl);
     curl_close($curl);
     return $contents;
    }

</pre>

<p>$links is my Links Array</p>

<pre>

    foreach ($links as $key => $value){
        $source = curl_file_get_contents($value);
    }

</pre>
