Jump to content

Archived

This topic is now archived and is closed to further replies.

anthropos9

Definition

Recommended Posts

Hi I've looked all over for this - including the php.net site - and couldn't find an answer. Can somebody tell me what => means? Thanks.

Share this post


Link to post
Share on other sites
It allows you to define an index in array ie:
[code]<?php

$myarray = array("index1" => "hello ", "index2" => "world");

//no to called each array for both the iondex1 and index2 array index
echo $myarray['index1'];
echo $myarray['index2'];

//out should be
hello world

?>[/code]

With out the definning an index you can access your arrays like so
$myarray[0] and $myarray[1] also.

Share this post


Link to post
Share on other sites
It's also used in the [a href=\"http://www.php.net/manual/en/control-structures.foreach.php\" target=\"_blank\"]foreach()[/a]. See the manual for more information.

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.