I have an array like this:
array(4) {
[0] => "1. \Device\NPF_{1AAAAA99-7933-4CBC-AF26-2A1C1394BD94} (VirtualBox Host-Only Network)"
[1] => "2. \Device\NPF_{2BBBBB88-75BB-4CD0-970A-36430287C245} (Wireless Network Connection 6)"
[2] => "3. \Device\NPF_{3CCCCC77-8469-4445-A2ED-9C0FDDBA1C3D} (Wireless Network Connection 7)"
[3] => "4. \Device\NPF_{4EEEEE66-2C9D-4D47-B7EA-8A20A40A149B} (Local Area Connection)"
}
and would like to manipulate into a new associative array like this:
array(4) {
["1"] => "VirtualBox Host-Only Network"
["2"] => "Wireless Network Connection 6"
["3"] => "Wireless Network Connection 7"
["4"] => "Local Area Connection"
}
I realise that I could use a foreach loop to go thru the original array then in each iteration use substr function to get the first char for the new array key and to look for the sentence inside the () pattern but failed to implement this. Any suggestion is much appreciated! Thanks!