This topic is locked

split content to multiple links

11/30/2017 5:39:06 AM
PHPRunner General questions
author

Hello

I have a field that contains different student' IDs separated with comma i want every student ID to be a link to his own view page like:

$students = explode(',', $data["student"]);
$value="<a target=_blank href='http://mywebsite/student_view.php?editid1=".$students ."'>$value</a> ";

but this does not work



Please help

admin 12/3/2017

explode() function returns an array of values. You need to loop through this array to build a link of links:

http://php.net/manual/en/control-structures.foreach.php