Adding a link in an array in PHP using href

This question already has an answer here:

  • PHP parse/syntax errors; and how to solve them? 13 answers

  • No need of the PHP tags. Try with -

    $table->data[] = array(
          'CSE1010', 
          'Intro To IT', 
          'Bsc Acc, Mgt', 
          '<a href="edit.php"><u>Edit</u></a>'
    );
    

    You should use something like this in Moodle

    $editurl = new moodle_url('/pluginfolder/pluginname/edit.php', array('id' => $id));
    $editlink = html_writer::link($url, get_string('edit'));
    $table->data[] = array('CSE1010', 'Intro To IT', 'Bsc Acc, Mgt', $editlink);
    

    $id is the id of the record you want to edit.

    链接地址: http://www.djcxy.com/p/69900.html

    上一篇: 我如何在应用程序之后动态添加包

    下一篇: 使用href在PHP中添加一个链接