Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

For that serve '=>'?

Status
Not open for further replies.

mlara

Programmer
Oct 22, 2001
32
CO
Hi

For that serve '=>'?

Thanks.
 
mlara ->[hammer] ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Hey, >:-< It was an accident! [pipe] excuse me... je je
 
Hey, hold on a minute here...

Are you talking about '->' or '=>'? These are two different things. '=>' is used for dereferencing of keys with values in an http://www.php.net/manual/en/language.types.array.php&quot;]array[/url]. It is kind of like the '=' assignment operator, but it only works inside arrays. It is used more often to create associative arrays, because number-indexed arrays don't need an explicit dereferencer.

Examples:

1. Indexed array:

$arr = array(&quot;me&quot;, &quot;you&quot;, &quot;them&quot;);

Creates an array of 3 elements: $arr[0] is &quot;me&quot;, $arr[1] is &quot;you&quot;, etc...

2. Associative array:

$arr = array(&quot;me&quot;=>&quot;rycamor&quot;, &quot;you&quot;=>&quot;mlara&quot;);

So now $arr[&quot;me&quot;] is &quot;rycamor&quot;, and $arr[&quot;you&quot;] is &quot;mlara&quot;.

It is unfortunate that this operator looks so much like the &quot;less-than-or-equal&quot; operator (<=). -------------------------------------------

Big Brother: &quot;War is Peace&quot; -- Big Business: &quot;Trust is Suspicion&quot;
(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top