How to count number of null values in a single object? is there any built in function?
How to count number of null values in a single object? is there any built in function?
Have to Manually Check That
You obviously posted in a wrong forum section. This topic must be moved, but I don’t know what forum section to choose (Yii or General PHP questions, depends on 2) and 3))
If you mean any php objects, then you have to do it manually.
If you mean CActiveRecord, then you can do it in loop:
$n = 0;
foreach ($model as $attribute)
if ($attribute === null)
$n++;
yes CActiveRecord… But i need to count in a single record…is foreach works?
thanks andy_s… done.