php question - Arrays with =>...

Soldato
Joined
4 Jul 2004
Posts
2,647
Location
aberdeen
Hello,
I have an array...

$example = array(
"parta" => "partb",
"parta1" => "partb1",
"parta2" => "partb2");

And want to do:

while (certaincondtion = true) {

if ( $example[$i] == $foo) {

echo $bar;
}

$i++;
}

I want the "$example[$i] " to look for "parta" (ie before the =>), and then i want to echo $bar, and set bar at the "partb" (ie after the =>)

How do i do this.....

cheers
 
Back
Top Bottom