Previous Section  < Day Day Up >  Next Section

2.4 Chapter Summary

Chapter 2 covers:

  • Defining strings in your programs three different ways: with single quotes, with double quotes, and as a here document.

  • Escaping: what it is and what characters need to be escaped in each kind of string.

  • Validating a string by checking its length, removing leading and trailing whitespace from it, or comparing it to another string.

  • Formatting a string with printf( ).

  • Manipulating the case of a string with strtolower( ), strtoupper( ), or ucwords( ).

  • Selecting part of a string with substr( ).

  • Changing part of a string with str_replace( ).

  • Defining numbers in your programs.

  • Doing math with numbers.

  • Storing values in variables.

  • Naming variables appropriately.

  • Using combined operators with variables.

  • Using increment and decrement operators with variables.

  • Interpolating variables in strings.

    Previous Section  < Day Day Up >  Next Section