I have an associative array as :
$headers=
Array
(
[MODULE_ID] => Module ID
[PLATFORM_ID] => Platform ID
[PACKAGE_GUID] => Package GUID
[AGGREGATE_PACKAGE] => Aggregate Package
[DELD] => Deld
)
Now I wish to change the position ofPackage ID at the top to resemble as :
$desired=
Array
(
[PACKAGE_GUID] => Package GUID
[MODULE_ID] => Module ID
[PLATFORM_ID] => Platform ID
[AGGREGATE_PACKAGE] => Aggregate Package
[DELD] => Deld
)
I tried array_unshift
method but it does not works in this case as it is an associative array.
unset($headers['PACKAGE_GUID']);
array_unshift($headers, 'PACKAGE_GUID');
How can I achieve it? Thanks.