Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions

Question

c. What steps can you take to help eliminate the stress?

Answered: 1 week ago