-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
  • 21,247
  • 6
  • 47
  • 54
K L P
  • 107
  • 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,041
  • 1
  • 11
  • 35