Created
November 28, 2022 11:53
-
-
Save AucT/d5b22ac05460ae8137c30757a52cc9d6 to your computer and use it in GitHub Desktop.
php echo selected / checked if equal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function echoIfEqual($value1, $value2, $echoText) { | |
if ($value1 == $value2) echo $echoText; | |
} | |
function echoIfEqualChecked($value1, $value2) { | |
echoIfEqual($value1, $value2, 'checked'); | |
} | |
function echoIfEqualSelected($value1, $value2) { | |
echoIfEqual($value1, $value2, 'selected'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment