Skip to content

Instantly share code, notes, and snippets.

@ChrisLTD
Created June 27, 2013 16:55
Show Gist options
  • Save ChrisLTD/5878178 to your computer and use it in GitHub Desktop.
Save ChrisLTD/5878178 to your computer and use it in GitHub Desktop.
Check if checkbox should be checked based on GET value
<?php
/*
* Check if checkbox should be checked based on GET value
*/
function isChecked($chkname,$value) {
if(!empty($_GET[$chkname])){
foreach($_GET[$chkname] as $chkval){
if($chkval == $value){
return true;
}
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment