Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
CURL get_content vs PHP file_get_contents
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Skythrust" data-source="post: 460017" data-attributes="member: 87030"><p>Hiya,</p><p></p><p>I would like to use CURL get_content with the same parameters als file_gets_content</p><p></p><p>Like below, I have add some parameters at file_get_contents (FALSE, NULL, 20, 100)</p><p></p><p>[CODE]</p><p>$URL= file_get_contents('http://192.168.2.126', FALSE, NULL, 20, 100);</p><p>[/CODE]</p><p></p><p>And I would like to use that for my CURL get_content,</p><p></p><p>[CODE]</p><p>$URL= 'http://192.168.2.126';</p><p></p><p>function get_content($URL){</p><p> $ch = curl_init();</p><p> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);</p><p> curl_setopt($ch, CURLOPT_URL, $URL);</p><p> $data = curl_exec($ch);</p><p> curl_close($ch);</p><p> return $data;</p><p>}</p><p>[/CODE]</p><p></p><p> 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. </p><p>Any advise?</p><p></p><p>Thanks!</p></blockquote><p></p>
[QUOTE="Skythrust, post: 460017, member: 87030"] 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) [CODE] $URL= file_get_contents('http://192.168.2.126', FALSE, NULL, 20, 100); [/CODE] 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; } [/CODE] 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! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
CURL get_content vs PHP file_get_contents
Top