Adding a link in an array in PHP using href -


this question has answer here:

i developing plugin moodle , have add data table created.

this code:

<?php  $table = new html_table(); $table->head = array('id', 'name', 'programme', 'edit', 'delete'); $table->data[] = array('cse1010', 'intro it', 'bsc acc, mgt', ?> <a href="edit.php"><u>edit</u></a> <?php); $table->data[] = array(); echo html_writer::table($table);  echo "... php data handling code";  echo $output->footer();  ?> 

i having problems add link inside table.
this part of code giving me error:

$table->data[] = array('cse1010', 'intro it', 'bsc acc, mgt', ?>  <a href="edit.php"><u>edit</u></a> <?php); 

the error message is:

parse error: syntax error, unexpected '?>', expecting ')' in c:\moodlewindowsinstaller-latest\moodlefile\server\moodle\local\try\index.php on line 29

i can understand way wrote incorrect. can me write correct way? thanks.

no need of php tags. try -

$table->data[] = array(       'cse1010',        'intro it',        'bsc acc, mgt',        '<a href="edit.php"><u>edit</u></a>' ); 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -