php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #8318 Feature request for cURL
Submitted: 2000-12-19 04:30 UTC Modified: 2001-01-03 11:11 UTC
From: paul at rydell dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.3pl1 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: paul at rydell dot com
New email:
PHP Version: OS:

 

 [2000-12-19 04:30 UTC] paul at rydell dot com
I would like to use cURL to read the HTML (or whatever I am fetching) directly into a variable instead of only into a file or STDOUT.

Something like:

$ch = curl_init("http://www.somepage.com/");
curl_setopt($ch,CURLOPT_VARIABLE,$myoutput);
curl_exec($ch);
print $myoutput;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-03 11:11 UTC] sniper@php.net
There is already CURLOPT_RETURNTRANSFER option
which can be used to to this.

<?php

$ch = curl_init("http://www.somepage.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$myoutput=curl_exec($ch);
curl_close($ch);

?>

There was a bug with CURLOPT_RETURNTRANSFER but it's 
now fixed in CVS.

--Jani

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Jun 15 20:00:02 2026 UTC