How to fetch / extract data using CURL in PHP?

This is an example that fetches / extracts the information that we get while we search in google as define:words.

Open and type define:zany in search box and press enter.

You will get list for definition of word zany.

In this example, using curl i am demonstrating to fetch the data from that page starting with <ul> tag to </ul> tag.

About the Author

has written 38 stories on this site.

18 Comments on “How to fetch / extract data using CURL in PHP?”

  • generic cialis wrote on 26 April, 2011, 21:14

    Many thanks for providing this post. It is really essential for me.

  • Tessa wrote on 29 April, 2011, 14:37

    I’m not easily ipmrsesed. . . but that’s impressing me! 🙂

  • Wedding planner wrote on 23 July, 2011, 23:49

    Great article thanks

  • chand wrote on 19 August, 2011, 10:22

    I need some help like i have api of one service provider and some tracking id’s. they are providing data in xml, and when i am passing id’s by using html text tag and posting to curl it is not coming but id is displaying on url. when i pass id directly it is comming. what to do.

  • admin wrote on 22 August, 2011, 7:52

    Hello chand , thanks for your queries. Please recheck your codes or test by making similar example in your local host. Without seeing actual scenario i cannot help…

  • chand wrote on 22 August, 2011, 10:15

    how to current status from this following file

  • admin wrote on 26 August, 2011, 12:11

    Hello Chand, the code below will give you value of first Current Status found on page . Hope this helps.

  • chand wrote on 29 August, 2011, 13:16

    2011-08-24 16:12

    how to take only date from this in php

  • admin wrote on 30 August, 2011, 5:12

    Hello friend chand, Please send your question clearly in my email so that i can find exact solution and help you. Thanks

  • chand wrote on 2 September, 2011, 12:25

    Thanks a lot for your help.

  • Kumar wrote on 26 April, 2012, 17:10

    How to fetch data in php(curl) from this site 1> i want train fare from one station to another 2> timings of train in current station 3> stations comes between one station to another

  • Gomathi wrote on 13 July, 2012, 4:09

    Good article and informative… keep it rock

  • ruchit wrote on 28 October, 2012, 16:05

    i want to extract and display data(textual and binary data) from a website that provides informations about different cars falling under a specified range of price….can you help me?
    i just want to use these urls in my database and search for the required data by crawling through these websites.

  • sujitha wrote on 5 January, 2013, 9:41

    thank u .it helps me alot

  • Sachin wrote on 27 June, 2013, 12:11

    Thanks a lot, much needed info. keep it up.

  • Utpal wrote on 13 October, 2018, 17:46

    Impressive info. Thanks for this kind help.

  • gaurav singh wrote on 10 October, 2020, 9:31

    Very useful article thank you so much


  1. Syntax highlighter not working in ie.. | WordPress Stack Exchange Monitor

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!


Copyright © 2022 Programmer to Programmer- A website for web programming and mobile application programming tutorials.
Wordpress themes