Beginner PHP Chapter 5 - Arrays - Code Block 8


/ 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.  
  4. print_r($patient1);
  5.  
  6. /* That will show you the following:
  7.  
  8. Array(
  9. [name] => Sandra James
  10. [age] => 45
  11. [bloodType] => B+
  12. [height] => 175
  13. [weight] => 65
  14. )
  15.  
  16. */
  17.  
  18. $patient1['weight'] = 62; //Been working out, Sandra?
  19.  
  20. print_r($patient1);
  21.  
  22. /* That will show you the following:
  23.  
  24. Array(
  25. [name] => Sandra James
  26. [age] => 45
  27. [bloodType] => B+
  28. [height] => 175
  29. [weight] => 62
  30. )
  31. */
  32.  
  33.  
  34.  
  35. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.