Adding a link in an array in PHP using href -
this question has answer here:
- php parse/syntax errors; , how solve them? 11 answers
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
Post a Comment