coder1.com

  • home
  • drupal articles
  • contact
Home

Control Structures

PHP foreach value by reference

Mike Milano — July 1, 2008 - 10:49pm

[img_assist|nid=9|title=|desc=|link=none|align=right|width=100|height=66] PHP5 added a very subtle yet very handy feature in the foreach Control Structure. It is the ability to access the value in the iteration as a reference to the original array.

The best way to demonstrate this is to establish an objective.

Objective: Write a function to capitalize all elements of an array.

  • Control Structures
  • PHP
  • 2 comments
  • Read more
Syndicate content

Poll

Have you used any NoSQL Databases?:

User login

  • Request new password

Navigation

  • Recent posts

  • home
  • drupal articles
  • contact