php - How do I sort a numeric data string into an array based on decimal values?
<p>I have a set of data which is a breakdown of call charges for international phone number prefixes. I need to parse the data so that I know the per minute cost of calling any number. The format is the cost followed by the prefixes. It is one big mess. the data looks like this: <code>cost,prefix,prefix,prefix,cost,prefix,prefix,prefix,prefix</code>.</p>

<p>The number of prefixes varies, but the cost is always 0.something (eg. <code>0.345</code>)</p>

<p>Example:</p>

<p><code>0.43,123,124,125,0.64,567,568,569</code></p>

<p>I need to reformat the data so I can programatically grab the cost of calling any prefix, so I know that calling prefix 123 costs 0.43 dollars, and calling 567 costs 0.64 dollars etc. For example, maybe I could lookup the desired prefix and find the cost that precedes it.</p>

<p>Can anyone help? Thanks</p>
