Beginner PHP Chapter 5 - Arrays - Code Block 13


/ Published in: PHP
Save to your folder(s)

Beginner PHP Chapter 5 - Arrays


Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. echo $patient1['name']; //This will display the string 'Sandra James'.
  4. echo $patient1['visits'][0]; //This will still display 'Array', because the returned value is an array.
  5. echo $patient1['visits'][1]['time']; //This will display the string '2.15PM'.
  6.  
  7. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.