Codeigniter Parse error: syntax error, unexpected T_CLASS

codeigniter

I am trying a simple code igniter hello world tutorial but keep getting this error and don't know why.

Parse error: syntax error, unexpected T_CLASS in
C:\xampp\htdocs\loxxbylisa\application\controllers\helloworld.php on
line 3

<? php

    class HelloWorld extend CI_Controller {

    public function index(){
            $this->load->view('helloworld');
        }

    }

?>

I am running it in XAMPP and my helloworld.php in views folder is just the text "hello world".
Any suggestions?

Best Answer

The only thing that jumps out at me right now is you have a space between your opening

class HelloWorld extends CI_Controller

Notice the "s" at the end of extend. Should be extends. http://php.net/manual/en/keyword.extends.php

Related Topic