<?php
// Enable error reporting for debugging
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Function to find the greater number
function findGreater($num1, $num2) {
if ($num1 > $num2) {
return "The greater number is: $num1";
} elseif ($num2 > $num1) {
return "The greater number is: $num2";
} else {
return "Both numbers are equal.";
}
}
// Running the function with example inputs for online compilers
$num1 = intval(readline("Enter first number: "));
$num2 = intval(readline("Enter second number: "));
// Output the result
echo findGreater($num1, $num2) . "\n";