Posted By

ashmenon on 09/09/12


Tagged


Versions (?)

Beginner PHP Chapter 5 - Arrays - Code Block 11


 / Published in: PHP
 

Beginner PHP Chapter 5 - Arrays

  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  

You need to login to post a comment.