var_dump(water("435f")); //result - true
var_dump(water("2c")); //result - false


function water ( $temp ) {
      $x = [ 'c'>=100, 'f'>=212 ];
      
      $y = substr ( $temp, -1 );
     
      $temp = substr_replace ( $temp, " ", -1 );
    
      $z = $temp >= $x[$y];
  
 return $z;    

by Gvanca Gharibashvili
2 years ago
PHP
0
Pro tip: use ```triple backticks around text``` to write in code fences