Guest User

Untitled

a guest
Jul 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. foreach ($table->find('tr') as $row) {
  2. $zero = $row->find('td',0)->innertext;
  3. $one = $row->find('td',1)->innertext;
  4. $two = $row->find('td',2)->innertext;
  5. $three = $row->find('td', 3)->innertext;
  6. $json[] = [ 'zero' => $zero, 'one' => $one, 'two' => $two, 'three' => $three ];
  7. }
  8. echo json_encode($json,JSON_PRETTY_PRINT);
  9.  
  10. {
  11. "zero": "four",
  12. "one": "",
  13. "two": "",
  14. "three": ""
  15. },
  16. {
  17. "zero": "zero",
  18. "one": "one",
  19. "two": "two",
  20. "three": "three"
  21. },
  22. {
  23. "zero": "zero",
  24. "one": "one",
  25. "two": "two",
  26. "three": "three"
  27. },
  28.  
  29. {
  30. "zero": "zero",
  31. "one": "one",
  32. "two": "two",
  33. "three": "three",
  34. "four": "four"
  35. },
Add Comment
Please, Sign In to add comment