- var_export: documentation ( source)
<?php
$array = [
147 => [
"pts_m" => "",
"pts_mreg" => 1,
"pts_cg" => 1
],
158 => [
"pts_m" => null ,
"pts_mreg" => null,
"pts_cg" => 0
],
159 => [
"pts_m" => "",
"pts_mreg" => 1,
"pts_cg" => 1
]
];
$truthyCount = 0;
foreach ($array as $row) {
foreach ($row as $v) {
$truthyCount += $v;
}
}
var_export($truthyCount);