Forums: split content to multiple links - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

split content to multiple links Rate Topic: -----

#1 User is offline   Alain 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 31
  • Joined: 12-February 17

Posted 30 November 2017 - 10:39 AM

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
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15771
  • Joined: 03-February 03

Posted 03 December 2017 - 10:51 AM

explode() function returns an array of values. You need to loop through this array to build a link of links:
http://php.net/manua...res.foreach.php
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked