I created string_functions_assignment.php to show two simple routines: writeMsg() and stringSummary($input). The latter runs a handful of string helpers: strlen, trim, str_word_count, strtoupper/strtolower, strrev, substr, strpos, and str_replace, and prints a small table of results. Save the file to the web server and open it over HTTP (for example, http://localhost/string_functions_assignment.php); remember to escape displayed text with htmlspecialchars and use mb_ functions when you expect non‑ASCII characters. A few problem came up while I was testing: editors (Notepad, TextEdit) may quietly add .txt I fixed that by using “Save As” and typing the .php extension explicitly; opening the file via file:// won’t execute PHP, so I switched to a local server (XAMPP/MAMP/WAMP or php -S localhost:8000) and loaded the page in a browser; and I hit 404s when links didn’t match files exactly, the cure was moving the .php into the server’s web root (htdocs/public_html) and ensuring href names and case matched exactly.
Leave a comment