-2

I am new to PHP and learning it with Codeigniter, While following a tutorial i get:

Parse error: syntax error, unexpected '⇒' (T_STRING), expecting ')' in C:\xampp\htdocs\stud\application\views\Stud_edit.php on line 16

while my Stud_edit.php looks like this:

<!DOCTYPE html> 
<html lang = "en">

   <head> 
      <meta charset = "utf-8"> 
      <title>Students Example</title> 
   </head> 

   <body> 
      <form method = "" action = "post">

         <?php 
            echo form_open('Stud_controller/update_student'); 
            echo form_hidden('old_roll_no',$old_roll_no); 
            echo form_label('Roll No.'); 
            echo form_input(array('id'⇒'roll_no', 'name'⇒'roll_no','value'⇒$records[0]→roll_no)); 
            echo "
            "; 

            echo form_label('Name'); 
            echo form_input(array('id'⇒'name','name'⇒'name',
               'value'⇒$records[0]→name)); 
            echo "
            "; 

            echo form_submit(array('id'⇒'sub mit','value'⇒'Edit')); 
            echo form_close();
         ?> 

      </form> 
   </body>

</html>

Can anybody please make out what's the mistake here?

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
Sunayana
  • 1
  • 5

1 Answers1

2

Most probably you have copy paste this from somewhere. There is special characters(⇒ and →) in your code which is not allowed

Change

echo form_input(array('id'⇒'roll_no', 'name'⇒'roll_no','value'⇒$records[0]→roll_no));

To

echo form_input(array('id'=>'roll_no', 'name'=>'roll_no','value'=>$records[0]->roll_no)); 
B. Desai
  • 16,414
  • 5
  • 26
  • 47