Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($table->find('tr') as $row) {
- $zero = $row->find('td',0)->innertext;
- $one = $row->find('td',1)->innertext;
- $two = $row->find('td',2)->innertext;
- $three = $row->find('td', 3)->innertext;
- $json[] = [ 'zero' => $zero, 'one' => $one, 'two' => $two, 'three' => $three ];
- }
- echo json_encode($json,JSON_PRETTY_PRINT);
- {
- "zero": "four",
- "one": "",
- "two": "",
- "three": ""
- },
- {
- "zero": "zero",
- "one": "one",
- "two": "two",
- "three": "three"
- },
- {
- "zero": "zero",
- "one": "one",
- "two": "two",
- "three": "three"
- },
- {
- "zero": "zero",
- "one": "one",
- "two": "two",
- "three": "three",
- "four": "four"
- },
Add Comment
Please, Sign In to add comment