Beginner PHP Chapter 5 - Arrays - Code Block 11


/ 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. //First let's combine the visits together.
  4.  
  5. $visits = array($visit1, $visit2, $visit3);
  6.  
  7. print_r($visits);
  8.  
  9. /* That will display like this:
  10.  
  11. Array(
  12. [0] => Array(
  13. [date] => 11/12/09
  14. [time] => 11.02AM
  15. )
  16. [1] => Array(
  17. [date] => 13/01/10
  18. [time] => 2.15PM
  19. )
  20. [2] => Array(
  21. [date] => 16/01/10
  22. [time] => 10.57AM
  23. )
  24. )
  25.  
  26. */
  27.  
  28. //And then we add this value to the patient variable.
  29.  
  30. $patient1['visits'] = $visits;
  31.  
  32.  
  33. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.