how to change the key of an array in php laravel code example Example: change key with the value php $arr[$newkey] = $arr[$oldkey]; unset($arr[$oldkey]);