frequency of words
Posted on 2000-03-20
if i have a variable $test that contains a block of text like this
"this is a test file when i will test out this program. the test will
now be set. i have to test out this program as the test will be used when i test out other programs."
and another variable $word which is "test"
(now bear in mind $test can be anything and $word can be anything
so id like a program that works on any example)
what id like to print out is
ie after "test" the word "file" occurs once
the word "out" occurs 3 times and the word "will" occurs twice
would anyone have the code to to print out this data given the
$test and $word variables ?