reading from a file to associative array in php
<p>I have a file codes.txt with records like this</p>

<pre><code>USA 0233
JPN 6789
TUN 8990
CDN 2345
</code></pre>

<p>I want to read these content of the file to an associative array like this. </p>

<pre><code>$codes["USA"] = 0233;
$codes["JPN"] = 6789;
$codes["TUN"] = 8990;
$codes["CDN"] = 2345;
</code></pre>

<p>this is the code that opens the file for writing. I need help in the array part. thks</p>

<pre><code>$myFile = "codes.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh)
</code></pre>
