=> <---- What is it?
Moderator: General Moderators
=> <---- What is it?
I'm new to programming and have seen the '=>' used and was wondering : What is it?
init stands for 'index' is mapped to 'value' - read $arr['index'] and you will get (edit:) 'value'.
init tells php not only to assign the value but also the kex/index for each entry.
Code: Select all
$arr = array('index'=>'value');in
Code: Select all
foreach($arr as $key=>$value)
Last edited by volka on Sat Oct 12, 2002 12:55 pm, edited 1 time in total.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
nope, that's >=conthox wrote:$a => $b
means that
$a is greater than or equal to $b
volka had it right, it's dealing with arrays
Code: Select all
$arr = array(
'abc' => 'value',
'def' => 'value',
'ghi' => 'value'
);
echo '<pre>';
foreach($arr as $key => $value){
echo $key." - ".$value."\n";
}
echo '</pre>';
print_r($arr);