Jump to content

Dont mean the difference


fahim

Recommended Posts

I am trying to program with php . Basically i am new here . Sometimes i face problem with a few sign that is totally unknown to me.Now a days the sign '=>' and '->' are new to me . i am confused with the use and the difference between them . i have no prior programming background . so these are new to me . i am asking frankly . as i have to learn them. Hope experts will kindly replay .

Thanks .

Fahim

Link to comment
Share on other sites

-> is object oriented programming and => is for arrays

 

$arr = array('bob', 'john', 'frank');

 

foreach ($arr as $key => $value) {

 

echo $key . ' - ' . $value;

 

}

 

That will output

 

0 - bob

1 - john

2 - frank

 

read up on OOP (object oriented programming) and arrays

 

Do a google search for them...both are PHP

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...