How do i get the title of the post and the image from a URL?
Say i enter a random URL, I want to get the main title of the post in that page and number of images and the images itself.
file_get_contents() doesnt help.
How do i get the title of the post and the image from a URL?
Say i enter a random URL, I want to get the main title of the post in that page and number of images and the images itself.
file_get_contents() doesnt help.
You could do it with file_get_contents, but I would recommend trying the HTML DOM library. Here is a decent blog post from Nettuts on this.
http://code.tutsplus.com/tutorials/html-parsing-and-screen-scraping-with-the-simple-html-dom-library--net-11856
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.