Jump to content

Recommended Posts

I've been looking for Curl tutorials and haven't really found any good ones. Can Curl take text from a website and store it in a variable? If so, can I get an example? If not, could someone please redirect me towards something it can?

 

Example:

A site has a list of items you've earned on a game, you want to store them and output them on your site.

 

If this isn't clear enough please let me know.

Link to comment
https://forums.phpfreaks.com/topic/233899-questions-about-curl/
Share on other sites

You can use cURL to grab the output content of a webpage, yes.  But you should first try using file_get_contents as that's a lot easier to use.  But either method returns the output content of the page, so you'll have to actually parse the page and grab specific content.  For that, you would use regex or a DOM parser

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.