I need this done in PHP only, I be stuck Using $input (below) as the input for t
ID: 645428 • Letter: I
Question
I need this done in PHP only, I be stuck
Using $input (below) as the input for the function, use PHP's string and array functions to write the code to:
Split the string into an array of values
Output the value of the third element in all capital letters
Output the sixth through ninth characters of the second array element
Add an element at the end of the array containing the character "%" (percent sign) repeated once for each character in the first element
Do Not Hard Code This Value.
You MUST programmatically generate this value.
Recombine the array, in reverse order, into a single string called $output.
Explanation / Answer
function fun($input)
{
$arr = array();
$arr=explode(" ",$input);
$third=strtoupper($arr[2]);
$subs=substr($arr[1],5,3);
$output=array_reverse($arr);
}
?>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.