Question: PHP You have a normal array, like: array(5, 7, 2, 88, 11, 10) There is a multi-conditions equation, that are: . if the input number

PHP

You have a normal array, like:

array(5, 7, 2, 88, 11, 10)

There is a multi-conditions equation, that are:

PHP You have a normal array, like: array(5, 7, 2, 88, 11,

.

if the input number is even, the output will be 5*input+12

if the input number is odd, the output will be 3*square feet of input.

.

The previously declared array has the inputted numbers.

You should loop on the array using foreach,

and perform the equation using if statements

and produce an associative array, like:

array(input => output, ... etc).

.

even 5x+12 odd 3x2

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!