It’s amazing how code can be used to solve everyday problems that could take a long time or forever. Recently, my wife, who is a teacher, needed to make tiles with letters for her students to compose their names. Normally, she would have to write out the names on paper and count exactly how many of each letter she would need. But with the following simple piece of PHP code, I was able to achieve the same:

$names = str_split('listofnameswithoutanyspaces');
 print_r(array_count_values($names));

Sometimes you just have to stay on the lookout to see where your programming skills may be of use.

Leave a Comment

Your email address will not be published. Required fields are marked *