'how to explode a string using a foreach [closed]

I got this string

$string = '1:23:health,2:24:mana';
$v = explode(",", $string);
foreach($v as $data)
{
    echo $data[0][1];
}

What im looking is to making a "multidimensional string" by exploding ','

Wanna do this:

data[0][0] = 1;
data[0][1] = 23;
data[0][2] = "health";

How can i do this in PHP?

php


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source