I have an array like this:
Array ( [PlasticContainmentTrained] => 0 [AvoidDustSpreadTrained] => 1 [PostRenCleaningTrained] => 0 [EntranceWarningSign] => 1 [IntObjectCovered] => 1 [IntHVAC] => 0 [IntWindowClosed] => 1 [ExtWindowClosed] => 0 [IntDoorClosed] => 1 [ExtDoorClosed] => 0 [DoorCovered] => 1 [IntFloorCovered] => 0 [ExtGroundCovered] => 1 [ExtVertContainment] => 0 [WasteContained] => 1 [AllChipsDebris] => 0 [WorkAreaSurface] => 0 [DustClearanceTesting] => 1 [WasteHandlingTrained] => 1 [MaintainContainmentTrained] => 0 [PostingWarningSignTrained] => 1 [DescriptionOfRenovation] => bnfdbndljnbljdfnbljkdnfljn [TrainedWorkers] => jvndfjnvdfvjndfljvndfljvn [DustSamplingTechnicanNames] => jvnfjdfnlvjdfjvndfljndflj [QualificationCopies] => dfjvdjf [KitUsed] => vjnjkdsfnvljdnvdjfvndfjbnjgbnndfn [TestLocations] => jdfjnvljndfvjdnfvjdnfvjkfnlj [CertifiedRenPerformed] => fdjndfljvndfljvndfjvndflk [ReportAttachPath] => undefined [IAccept] => undefined [ProjectId] => 1 )
and i want to filter this array but only 'undefined' values not '0'. i have used array_filter() function for this:
function filterValue($var)
{
if($var=='0')
{
return 0;
}
elseif($var!='undefined')
{
return $var;
}
}
$this->data = array_filter($_POST, "filterValue");
but it also filters '0' values. how can i do this.
Please any body help me...