Jump to content


Photo

Definition


  • Please log in to reply
3 replies to this topic

#1 anthropos9

anthropos9
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 April 2006 - 01:32 PM

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.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 April 2006 - 01:45 PM

It allows you to define an index in array ie:
<?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

?>

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

#3 anthropos9

anthropos9
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 April 2006 - 01:55 PM

Thanks. I know it was kind of stupid question, so thanks for not flaming me.

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 26 April 2006 - 02:05 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users