How to create a php script


Discuss the following:

Create a PHP script named states.php that creates a variable $states with the value "Mis- sissippi AlabamaTexas Massachusetts Kansas". The script should perform the following tasks:

a) Search for a word in $states that ends in xas. Store this word in element 0 of an array named $statesArray.

b) Search for a word in $states that begins with k and ends in s. Performa case-insensitive comparison. Store this word in element 1 of $statesArray.

c) Search for a word in $states that begins with M and ends in s. Store this element in element 2 of the array.

d) Search for a word in $states that ends in a. Store this word in element 3 of the array.

e) Search for a word in $states at the beginning of the string that starts with M. Store this word in element 4 of the array.

f) Output the array $statesArray to the screen.

 

 

 

 

 

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: How to create a php script
Reference No:- TGS01932712

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)