I have an array, $row2.
In $row2 two arrays are present. The output of $row2 is:
Array
(
[0] => Array
(
[Proposal_id] => 9
[row] => 1
[col1] => 2
[col2] => 2
[col3] =>
[col4] =>
[col5] =>
[Type] => customtbl
[Invoice_term] =>
[Qoute] =>
[Rate_per_hour] =>
[Total] =>
)
[1] => Array
(
[Proposal_id] => 9
[row] => 2
[col1] => 3
[col2] => 4
[col3] =>
[col4] =>
[col5] =>
[Type] => customtbl
[Invoice_term] =>
[Qoute] =>
[Rate_per_hour] =>
[Total] =>
)
)
I want to remove null elements from the array, but I can't do this.
I tried the following methods:
array_filter($row2);
array_filter($row2, function($var){return !is_null($var);});
array_diff($rows2, array("null", ""));