Skip to content
Advertisement

how display the number of occurrences of each letter in this string

I have an exercise I don’t know how to solve, because I am a beginner in php, here is the exercise summary: the "str_split" function allows you to convert a character string into an array (if we have a $s string that we want to store in a $tab array, we will write "$ tab = str_split ($ s);". using this function, create a function which takes as parameter a character string and display the number of occurrences of each letter in this string.

JavaScript

Advertisement

Answer

Something like below should work?

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement