I am creating an array like this
$prices = array ('tires'=>100, 'oil'=>100, 'spark plugs'=>4 );
or like this
$prices['tires']=100;
$prices['oil']=10;
$prices['spark plugs']=4;
first one I specificy the '=>' in the other way I can just use '='
Not sure what '=>' is suppose to do more? then just '='
Going through my php book I don't have a '=>' operator
I have '<=' and '>='
Is '=>' not an operator?
Thanks
meaning of '=>'
Moderator: General Moderators
- AVATAr
- Forum Regular
- Posts: 524
- Joined: Tue Jul 16, 2002 4:19 pm
- Location: Uruguay -- Montevideo
- Contact:
in:
"=>" means... key with value .. with that symbol you asign a value to a key. its not an operator.
when you asign values one by one, you make this:
here you asign array with some key the value you want... check this out http://www.php.net/types.array
Code: Select all
$prices = array ('tires'=>100, 'oil'=>100, 'spark plugs'=>4 );when you asign values one by one, you make this:
Code: Select all
$pricesї'key'] = 'value';