<?php
class Cart extends CI_Controller{
public $paypal_data = '';
public $tax;
public $shipping;
public $total =0;
public $grand_total;
//cart index
public function index(){
//load view
$data('main_content') = 'cart';
$this->load->view('layouts/main', $data);
}//end function
//add to Cart
public function add(){
//item data in a array construct
$data = array('id'=> $this->input->post('item_number'), 'qty'=> $this->input->post('qty'), 'price'=> $this->input->post('price'), 'name'=> $this->input->post('title'));//end statement
}//end function
}//end class cart
The above code causes error as follows:"Fatal error: Cant' use function return value in write context". I looked and searched many time at the above code but just can not seem to find the error. I would greatly appreciate it if someone can help.