-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
)
0

1 Answer 1

-1

Just use array_values

array_values($array_name);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.