Приглашаем посетить
Есенин (sergeiesenin.lit-info.ru)

4.6 Chapter Summary

Previous Table of Contents Next

4.6 Chapter Summary

Chapter 4 covers:

  • Understanding the components of an array: elements, keys, and values.

  • Defining an array in your programs two ways: with array( ) and with square brackets.

  • Understanding the shortcuts PHP provides for arrays with numeric keys.

  • Counting the number of elements in an array.

  • Visiting each element of an array with foreach( ).

  • Alternating table row colors with foreach( ) and an array of color values.

  • Modifying array element values inside a foreach( ) code block.

  • Visiting each element of a numeric array with for( ).

  • Alternating table row colors with for( ) and the modulus operator (%).

  • Understanding the order in which foreach( ) and for( ) visit array elements.

  • Checking for an array element with a particular key.

  • Checking for an array element with a particular value.

  • Interpolating array element values in strings.

  • Removing an element from an array.

  • Generating a string from an array with implode( ).

  • Generating an array from a string with explode( ).

  • Sorting an array with sort( ), asort( ), or ksort( ).

  • Sorting an array in reverse.

  • Defining a multidimensional array.

  • Accessing individual elements of a multidimensional array.

  • Visiting each element in a multidimensional array with foreach( ) or for( ).

  • Interpolating multidimensional array elements in a string.

    Previous Table of Contents Next