Where am I going wrong?

There is an error in my php code but I can’t figure out how to fix it. I want the value of the url to ‘name’ but something is wrong.

function displayData() {
  $jsonData = file_get_contents('userdata.json');
  $data = json_decode($jsonData, true);

  echo '<ul class="data-list">';
  foreach ($data as $row) {
    echo '<li>';
    echo '<a class="name" href="'$row['name']'">' . $row['name'] . '</a>';
    echo '</li>';
  echo '</ul>';


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.