0

how can i output more when 1 array. when i delete , ["nr"] evrything works. but i need the second one too...

<div>
      <select name="name[]">
           <option value = ""> Select the person with phone nbr. </option>
           <?php foreach ($results as $output) {?>

           <option> <?php echo $output ["fname"],["nr"]; ?> </option>

      <?php } ?>
      </select>
 </div>
2
  • 1
    What is the expected HTML output? Also, this seems prone to XSS. Commented Aug 12, 2020 at 16:04
  • <option value="SOME_VALUE"> <?php echo $output ["fname"].",".["nr"]; ?> </option> Commented Aug 12, 2020 at 16:05

1 Answer 1

1

does "nr" is an index of $output array? if so, then you have to write it like this:

<?php echo $output["fname"]  . "," . $output["nr"]; ?>
Sign up to request clarification or add additional context in comments.

1 Comment

@whoamiidontknowit can you please accept the answer as solution? :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.