Nofu/app/utils/Select.php
2024-06-14 17:20:01 +02:00

20 lines
490 B
PHP

<?php
namespace Utils;
class Select {
/**
* Check if a given value is selected.
*
* @param mixed $ref The reference value to compare against.
* @param mixed $param The value to compare.
*
* @return string The string 'selected' if the values match, or an empty string otherwise.
*/
static function isSelected(string $ref, string $param): string {
if ($ref === $param) {
return 'selected';
}
return '';
}
}