PHP remove array if subarray empty
问题 my array image just like this, if subarray "name" is empty or null i want delete array, how to do that ? here my current script $data = array(); $fixedData = array(); $countyName = array(); $numrow = 2; echo "<pre>"; // insert to tb participant => 1 foreach($sheet as $key => $row){ $data[] = array( 'name' => $this->split_name($row['B']), 'phone' => $row['D'], 'mobile' => $row['E'], 'institution' => $row['F'], 'departement' => $row['G'], 'address' => $row['H'], 'country' => $row['I'], );