4.3. Accessing Individual CharactersThe strlen( ) function returns the number of characters in a string: $string = 'Hello, world'; $length = strlen($string); // $length is 12 You can use array syntax (discussed in detail in Chapter 5) on a string, to address individual characters:
Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|