I’m trying to learn some PHP, and I’ve been banging my head against this problem for hours. at this point, I’m pretty sure I’ve made it far more complicated than it ought to be (the last attempt I just scratched was ~100 lines long (admittedly, lots of comments).
Here’s what I’m trying to do:
Read in a string, put the words in an associative array by number of letters, inside of which
is an associative array of words, sorted alphabetically, and the number of times they appear.
The next problems in the series build on this one, so I’m basically dead in the water until I can figure this out.
Any suggestions?
This is a bit nasty, but it gets the job done. Note that I reversed the first “my” and “is” to show the alphabetical reordering.