Hi
I've never been much good at grasping for(), foreach() and while() and i'm having yet another problem.
Lets say I have a string that reads:
$string = "1=red,3=blue,9=yellow";
I want to split that string twice using explode. Once to get rid of the commas, and secondly the equals. Here is my code so far:
$foo = explode(",", $string); //create array stripping the commas
$val = count($foo); //count the contents in array (in this case 3)
for($count=0; $count<$val; $count++)
{
$list = explode("=", $equip['$count']); //create array stripping out equals for each of the contents in the array
echo "number:".$list['0']." details:".$list['1']."<br>"; //display the result
}
so it should print:
number: 1 details: red
number: 2 details: blue
number: 3 details: yellow
But i don't get anyting, and i just can't get my head round why. Can anyone help?
Thanks
Ant
number: