Save cURL output to string

Started on the old forum in November 2010 · view the original in the archive · old links redirect here

#curl #php

No replies · 1,019 views · started 16 years ago · 1 min read

BioBeo Developer · 67 posts #1

You can save the cURL output as a string for further manipulation.

Following code takes care of:

<?php
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "http://example.com");
// return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// save output to string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
?>

USE THE THANKS BUTTON IF YOU LIKE THIS

Comming Soon:

WWW.BIOBEO.COM Bangladesh Internet On Best Economic Organizations (B I O B E O)

No one could help you If you don't help yourself. My facebook

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close