 <p>Your code should look something like this,</p> <pre><code>&lt;?php $items_extended = array("1. \\Device\\NPF_{1AAAAA99-7933-4CBC-AF26-2A1C1394BD94} (VirtualBox Host-Only Network)", "2. \\Device\\NPF_{2BBBBB88-75BB-4CD0-970A-36430287C245} (Wireless Network Connection 6)", "3. \\Device\\NPF_{3CCCCC77-8469-4445-A2ED-9C0FDDBA1C3D} (Wireless Network Connection 7)", "4. \\Device\\NPF_{4EEEEE66-2C9D-4D47-B7EA-8A20A40A149B} (Local Area Connection)"); $items = array(); foreach($items_extended as $key =&gt; $value){ preg_match('#\((.*?)\)#', $value, $match); $items[($key + 1)] = $match[0]; } ?&gt; </code></pre>