Replace Array Value using key in laravel

below code is example for change or replace the value of array using key. 


$parameter = [10, 20];

i have to change 20 to 69 then below is the code

$a2 = ["1" => 69];
$parameters = array_replace($parameters, $a2);

Final result will be

$parameter = [10, 69];


Comments

Popular posts from this blog

Group by Provider ID of Logged in User in Laravel

Name Validation in Laravel