java程序员学php – 7. Map被称作关联数组

如:

  $map[‘BJ’] = ‘Beijing’;

  $map[‘SH’] = ‘Shanghai’;

遍历这个关联数组:

  foreach($map as $abbr=>$full_name){

      echo "$abbr is short for $full_name";

  }

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.