I got an array with values splits to 5 arrays with groups of 3 values, then I got more group of array of pointers, what I'm trying to do is replacing the pointed array with other value.
what I got is :
$a = array(["4", "3", "5"], ["4", "8", "11"], ["4", "11", "5"], ["4", "5", "5"], ["4", "4", "9"]);
$b = array(12); // the value to be placed
$pointers = array([1,2],[2,2],[2,1]);
foreach($pointers as $point)
{
$a1 = array_replace($a[$point[0]], array($point[1] => $b ));
}
Expected results:
["4", "3", "5"], ["4", "8", "12"], ["4", "12", "12"], ["4", "5", "5"], ["4", "4", "9"]
What I need is to keep the array structure as is and just replace the pointed values to be 12.
I'm not sure its the right way.