Module #6 and #7
Functions and strings are connected in PHP because functions are often used to work with and change string data. A function helps organize code into reusable sections, while string functions allow us to perform actions on text, like counting characters, changing uppercase and lowercase letters, or counting words. In my assignment, I created my own function called analyzeMessage(). This function takes a string as a parameter. Inside the function, I used built-in PHP string functions like strtoupper() to convert the text to uppercase, strlen() to find the total number of characters, and str_word_count() to count how many words were in the sentence. By combining functions and strings, I was able to keep my code organized and avoid repeating the same code multiple times. Instead of rewriting everything, I just passed a different string into the function. This shows how functions help structure programs better, while string functions make it easier to analyze and manipulate text. O...