-4

I have a table here which is containing some data,So i want to copy that data and wants to print it on my webpage by the php script,So someone please help me out,If u dont mind anyone contribute the suitable code here for this question.

2 Answers2

1

Use a DOM Parser like SimpleHTMLDom.

include 'simple_html_dom.php';
$html = file_get_html('http://result.msrit.edu/getresult.php?myusn=1ms10cs410&B1=GET%20RESULT');
$elems = $html->find("/html/body/table/tbody/tr[1]/th[1]/div"); 

foreach($elems as $v) 
{

//do the parsing here 

}

Read the documentation for the available options and examples.

Hope this helps!

Amal Murali
  • 75,622
  • 18
  • 128
  • 150
1
$dom = new DomDocument();
@$dom->loadHTML(file_get_contents ('http://result.msrit.edu/getresult.php?myusn=1ms10cs410&B1=GET%20RESULT'));
$table=$dom->getElementsByTagName('table');
echo $dom->saveHTML($table->item(0));
trijin
  • 483
  • 3
  • 6