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!
Output:
= wordDigit($_GET['numberNames']) ?>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started