From the course: PHP for Non-Programmers

Unlock the full course today

Join today to access over 25,200 courses taught by industry experts.

What the analyzer should do

What the analyzer should do - PHP Tutorial

From the course: PHP for Non-Programmers

What the analyzer should do

- [Tutor] For this project, we're going to create something that really shows the power of functions, a text analyzer. For the requirements using text that is provided to you, the text analyzer should, count the total number of words in the provided text. And count the number of times a given string appears in the text. Counting the given string should be case insensitive, which means upper and lowercase should both count. The user should provide the word to count. A couple of notes. We are looking for strings here, not strictly words. So if we are counting all of the instances of "he", for example, both "he" and "hero" would count. The text should be printed on the screen as a reference for the user. And while not required, allowing the user to enter more than one word and then enter zero to exit would be a fun bonus. The best thing to do here is to write a couple of functions, so that's what we'll do first.…

Contents