Can a script count the number of letters in a page and total the occurences of each letter
a = 6 b = 1 c = 7 etc...
$text = 'this is a bunch of text'; $array = str_split($text); $count = array_count_values($array); foreach ($count as $key => $value) { if ($key == ' ') {$key = '[space]';} echo $key . ' occurs ' . $value . ' time(s)<br>'; }
Fatal error: Call to undefined function: str_split()
you have 2 choices:
option #1 is preferable (if possible)
still how could I put the entire contents of a page into :
$text = 'this is a bunch of text';
?
Originally posted by rayzun still how could I put the entire contents of a page into : $text = 'this is a bunch of text';
[man]file_get_contents[/man]
I guess that is a solution, all HTML needs to be stripped.
I should have my head a shake.
That is kind of bad though I think having to load the same page twice. ?
Ever looked at [man]count_chars/man?