How can PHP be utilized to categorize and assign values to numbers within specified ranges?

To categorize and assign values to numbers within specified ranges in PHP, you can use conditional statements like if-else or switch-case to check the value against the specified ranges and assign the corresponding category or value.

$number = 75;

if ($number >= 0 && $number <= 25) {
    $category = "Low";
} elseif ($number > 25 && $number <= 75) {
    $category = "Medium";
} else {
    $category = "High";
}

echo "Number $number falls into the category: $category";