Help me please. There are 2 parameters in JSON: 1) name 2) link How to make the name (1) follow the link (2) when clicked

  • where should it even be? - lampa
  • In the echo table, "<tr> <td>". $ Object ['title']. "</ Td> <td>". $ Object ['link']. "</ Td> </ tr>"; - iglon
  • Telepaths guess that things happen in php, so do $ object = json_decode ($ json) - Snow

1 answer 1

As an option like this:

"<tr><td><a href='".$object['link']."'>".$object['title']."</a></td><td>".$object['link']."</td></tr>"; 

Well, if you need to get exactly from 2

 "<tr><td onclick='window.location.href=document.getElementById(\"link\").innerHTML'>".$object['title']."</td><td id='link'>".$object['link']."</td></tr>";