How to use Explode in my case?
<p>I have a variable that contains text with values according to an example below:</p>

<pre><code>$data = "5:7|4:1|504:2|1:3|"
</code></pre>

<p>And I would like to achieve results like this:</p>

<pre><code>$data[5] = 7;
$data[4] = 1;
$data[504] = 2;
$data[1] = 3;
</code></pre>

<p>I tried with explode:</p>

<pre><code>$data = explode("|", $data);

//but it makes $data[0]="5:7"; $data[1]="4:1"; and so on.
</code></pre>

<p>Should I use explode again? Is it has any sense, or is there another way? I would like to ask for a hint or help.</p>
