I’m working on a function to check wheter a $_POST is set or not.
The following works fine:
if (isset($_POST['einfo'])) {
$einfo = $_POST['einfo'];
} else { $einfo = NULL; }
echo $einfo;
And this is the function i’m trying to make:
function ifset($check) {
if (isset($_POST['$check'])) {
$check = $_POST['$check'];
} else { $check = NULL; }
return $check;
}
$einfo = ifset('einfo');
echo $einfo;
But i get no output.
You have to use double quotes:
But actually you can omit them.