Question: please help to Complete the program by adding a PHP function named wordDigit() that takes in one argument $word The first statement in the function

please help to Complete the program by adding a PHP function named wordDigit() that takes in one argument $word

The first statement in the function should convert the argument string to an array. hint: explode()

The next statement should declare and initialize the $result variable with an empty string

Then in a foreach() loop use a switch() (you may want to trim() the input) with 10 cases to determine what word needs to be converted to its corresponding digit and then append the result to the $result variable

Echo out the $word variable followed by an HTML line break tag.

Then return the $result

here is what I got so far

//add your wordDigit() function here

?>

Explode

Explode!

Output:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!