-1

What are the uses of -> and => in PHP. I have been trying the same since long time.Please do someone answer with examples.

$data['student_last_name'] = $this->input->post('student_lastname');
Narendrasingh Sisodia
  • 20,667
  • 5
  • 43
  • 53
K L P
  • 97
  • 6

1 Answers1

3

-> is used to access object property and => is used to assign value to array key.

Example:

$name = $person->name;

$newArray = array(
    "name" => "John"
)
Sagar Guhe
  • 1,161
  • 1
  • 11
  • 34