1

Hi I want to analyze HTML page by following example.

  1. I can put url page to textfield then press enter.
  2. I get some text from HTML page such as title, h1, div id="do" or so on.

How I can do it by using PHP?

Thanks!

Giffary
  • 2,872
  • 10
  • 45
  • 69

3 Answers3

2

With file_get_contents() or the like and an HTML parser.

Ignacio Vazquez-Abrams
  • 740,318
  • 145
  • 1,296
  • 1,325
1

You want to use PHP's curl functions, here's a quick tutorial.

TravisO
  • 9,210
  • 4
  • 34
  • 44
1

Use file_get_contents or cURL, then use the explode functions to get data from the tags if using file_get_contents OR use "regex" for the particular html tag for getting the data

Jon Winstanley
  • 22,404
  • 20
  • 73
  • 111
Ankur Mukherjee
  • 3,639
  • 5
  • 29
  • 38