Meran ahmed wrote:i have this code which calculate the instance of each character in the file ,I want to calculate the frequency of each character alone and i want to get the maximum frequency between them
I can't understand what you try to achieve. Can you give some further explanation? It would even better to provide some sample data and share the output produced with your current code and the output you want to get.
Meran ahmed wrote:i want to make a code which determines that the frequency of a=2 and b=1 ....
That's exactly what the str_word_count function will return. But I guess you didn't even bother to look at that link I provided, otherwise you would have known and you could have developed the necessary code yourself. It seems you are looking for a ready-to-use solution. Unfortunately that's not going to happen on CodeRanch: we are NotACodeMill and you shouldShowSomeEffort. This is a nice quote which illustrates perfectly what we are trying to do here at CodeRanch: Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.