0

I need to get associative array but need to filter it with keys (array)

array:5 [▼ //associative array
  1 => 0.0
  2 => 0.369271
  3 => 0.606341
  4 => 0.597023
  5 => 0.0
]
array:2 [▼ //reguler array
  0 => 2
  1 => 4
]
array:5 [▼ //The result should be like this
  2 => 0.369271
  4 => 0.597023
]

I've tried with array_diff_key but it's not what I expecting

Ray Coder
  • 1,022
  • 3
  • 15
  • 30

0 Answers0