see how you guys are??? i give the most simple answer and you go and take the next step and help him (or her) out even more...
... just kidding... that's what I love the most about this place (phpbuilder)!!
but seriously for a minute, just an extra tip that when you use the foreach() make sure that you first test that the var is an array or php will throw an ugly error. I'm adding this because the original poster stated that 'I always get stuck on easy stuff' and I remember that was an error I hated when I first started with php4....
heres the code, to use LordShryku 's example
$file = '&count1=1&count2=3&count3=6';
$count = explode('=',$file);
$numbers = array();
foreach($count as $c) {
$num = str_replace(strstr($c,"&"),"",$c);
if(!empty($num)) {
$numbers[] = $num;
}
}
would be best as
$file = '&count1=1&count2=3&count3=6';
$count = explode('=',$file);
$numbers = array();
if (is_array($count)) {
foreach($count as $c) {
$num = str_replace(strstr($c,"&"),"",$c);
if(!empty($num)) {
$numbers[] = $num;
}
}
} else {
// some code for the times when flash doesn't send vars, maybe a
die("Error, vars haven't made it from Flash...<br>");
}
Happy Holidays to All!