-2

I have a PHP array as below :

Array
(
    [Cpu] => Cpu
    [Memory] => Memory
    [Ping] => Ping
    [Interface - Ethernet] => Interface - Ethernet
    [Disk - C:] => Disk - C:
    [Disk Reponse - C] => Disk Reponse - C
    [Top Memory] => Top Memory
    [Top Cpu] => Top Cpu
    [Process - DFSR] => Process - DFSR
    [Process - DNS] => Process - DNS
    [Process - IsmServ] => Process - IsmServ
    [Process - lsass] => Process - lsass
    [Process - svchost] => Process - svchost
    [Process] => Process
    [Interface] => Interface
    [Disk] => Disk
    [Disk Reponse] => Disk Reponse
    [Link-Discovery] => Link-Discovery
    [Microsoft Hyper-V Network Adapter #2] => Microsoft Hyper-V Network Adapter #2
    [Mellanox ConnectX-4 Lx Virtual Ethernet Adapter] => Mellanox ConnectX-4 Lx Virtual Ethernet Adapter
)

I need to replace array KEY to numbers according to array length starting from '0'(zero) as below ,

Array
(
    [0] => Cpu
    [1] => Memory
    [2] => Ping
)
James.R
  • 23
  • 8

1 Answers1

-1

Just use array_values

array_values($array_name);
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85