Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. array (
  2. 'routes' =>
  3. array (
  4. 0 =>
  5. array (
  6. 'legs' =>
  7. array (
  8. 0 =>
  9. array (
  10. 'summary' => '',
  11. 'weight' => 3741.9,
  12. 'duration' => 2912.3, // This value is what i want access
  13. 'steps' =>
  14. array (
  15. ),
  16. 'distance' => 21603.1, // This value is what i want access
  17. ),
  18. 1 =>
  19. array (
  20. 'summary' => '',
  21. 'weight' => 3642.1,
  22. 'duration' => 2777.4, // This value is what i want access
  23. 'steps' =>
  24. array (
  25. ),
  26. 'distance' => 21611.8, // This value is what i want access
  27. ),
  28. ),
  29. 'weight_name' => 'routability',
  30. 'weight' => 7384,
  31. 'duration' => 5689.700000000001, // This value i can acesss
  32. 'distance' => 43214.899999999994, // This value i can acesss too
  33. ),
  34. ),
  35. 'waypoints' =>
  36. array (
  37. 0 =>
  38. array (
  39. 'hint' => '',
  40. 'distance' => 16.78277948979663, // This value is what i want access
  41. 'name' => 'Weg',
  42. 'location' =>
  43. array (
  44. 0 => 11.4623,
  45. 1 => 50.7126,
  46. ),
  47. ),
  48. 1 =>
  49. array (
  50. 'hint' => '',
  51. 'distance' => 16.62835508134535,
  52. 'name' => 'Weg',
  53. 'location' =>
  54. array (
  55. 0 => 12.6069,
  56. 1 => 51.5398,
  57. ),
  58. ),
  59. 2 =>
  60. array (
  61. 'hint' => '',
  62. 'distance' => 16.78277948979663,
  63. 'name' => 'Weg',
  64. 'location' =>
  65. array (
  66. 0 => 12.343,
  67. 1 => 51.576,
  68. ),
  69. ),
  70. ),
  71. 'code' => 'Ok',
  72. )
  73.  
  74. foreach($res2['routes'] as $item)
  75. {
  76. $distances = array_push_assoc($distances, $item['distance'], $item['duration']);
  77. }
  78.  
  79. foreach($res2['routes']['legs'] as $item)
  80. {
  81. $durations = array_push_assoc($durations , "DUR", $item['duration']);
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement