This exercise introduces some more of the PHP string manipulation functions. Using SurnameSearch.html as a template, write an HTML form to gather a single string of data from end users. Using version...


This exercise introduces some more of the PHP string manipulation functions. Using SurnameSearch.html as a template, write an HTML form to gather a single string of data from end users. Using version 0.1 of the SurnameStub.php script (Figure 4.3) as a template, write a PHP stub program to process the data entered as described below. In each case, display the results to end users.


(a) Use the built-in PHP function strlen() to find the length of the string entered.


(b) Use the built-in PHP functions strtolower() and strtoupper() to change the case of the letters entered by the user.


(c) Use the built-in PHP function strpos() to find the position of the first occurrence of the letter ‘e’ in the string. Then find the position of every letter ‘e’. (Hint: You can use a loop statement to do this.)


(d) Use the built-in PHP functions strpos() and substr() to split the string at the first space character and display the two halves on separate lines of the web page. (e) Suggest why these string manipulation functions can be useful in a web database application.


Nov 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here