Skythrust
Member
- Jul 9, 2019
- 133
- 7
Hiya,
I would like to use CURL get_content with the same parameters als file_gets_content
Like below, I have add some parameters at file_get_contents (FALSE, NULL, 20, 100)
And I would like to use that for my CURL get_content,
I have tried to add these in my echo and inside my function but I can't realize this. My goal is to show text/parameters from a different (external) page.
Any advise?
Thanks!
I would like to use CURL get_content with the same parameters als file_gets_content
Like below, I have add some parameters at file_get_contents (FALSE, NULL, 20, 100)
Code:
$URL= file_get_contents('http://192.168.2.126', FALSE, NULL, 20, 100);
And I would like to use that for my CURL get_content,
Code:
$URL= 'http://192.168.2.126';
function get_content($URL){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
I have tried to add these in my echo and inside my function but I can't realize this. My goal is to show text/parameters from a different (external) page.
Any advise?
Thanks!