Create a function that calculates the temperature to Celcius or Fahrenheit. It takes 2 arguments, a float and a string.
- The value of string MUST be 'FtoC' of 'CtoF'. If it is a different value an error should be printed.
- The return value is an array that incorparates the temperature value and the temperature type, see example below.
- Bare in mind that if another programmer should look at your code it should be obvious what you are trying to accomplish. So choose the name of your function and arguments well
with this homework assignment you are supposed to find out how you calculate this mathematically and turn that into a php function.
Example:
$returnvalue = ['temperature' => 20.1, 'type' => 'Celsius' ];