检查$ _POST是否存在和值

I am trying to check if $_POST exists and check only for a specific value. In my code I am trying to check for data header=h1. The code works, it checks for data header but I do not know how to specify for value of header i.e check for header=h1

if ($_POST['data']['header']){
    $myBuildPath = Config::$buildPath.Users::$userid.'/'.$item[$this->mainModel->primaryKey].'/';
    foreach (Config::$repository['headersCustomDest'] as $file => $fileDestPath){
    $dest_file = $myBuildPath.$fileDestPath;

    if(file_exists($file)) full_copy($file,$dest_file);
    else echo $file.' does not exist.';
}
if(isset($_POST['data']['header']) && $_POST['data']['header'] == 'h1')
{
    // blah
}

Should do the trick.

Is this what you mean?

if(isset($_POST['data']['header']) && $_POST['data']['header'] == 'h1') {

Change your condition and check with == with value

if (isset($_POST['data']['header']) && $_POST['data']['header'] == 'h1'){