How to convert a string to array in php?
<p>This is not the <code>explode</code> can solve</p>

<p>I have several array</p>

<pre><code>$order
data: {5,3,2}

$title,
data: {USA, England, China}

$attribute
Same idea 

$type
Same idea 
</code></pre>

<p>The $order has already exist some value<br>
{5,3,2}  and 
for each  has its $title,$attribute,$type value correspondingly </p>

<pre><code>eg. 5 USA  att5 type5
</code></pre>

<p>I would like to sort the order to {2,3,5} and the corresponding data in other array will be sorted too.</p>

<pre><code>eg. {2,3,5}
</code></pre>

<p>For the array $title afterwards </p>

<p>is</p>

<pre><code>{China, England,USA}
</code></pre>

<p>How to implement this for all arrays? Thank you</p>

<p>My idea is using an associative array , and i can sort the key, and everything is done. However, I can not generate the array  </p>

<p>My idea array:</p>

<pre><code>$records = array(5 =&gt; array("title" =&gt; "USA",   "att" =&gt; "add5"),
                 3 =&gt; array("title" =&gt; "England",  "att" =&gt; "add3"),
                 2 =&gt; array("title" =&gt; "China", "att" =&gt; "add2"));
</code></pre>
