SELECT CONCAT(upper(substr("test this one.", 1, 1)),"", LOWER(SUBSTR("test this one.", 2, length("test this one."))));
In above query, the string "test this one." can be replaced by the field name while performing query in database.
SELECT CONCAT(upper(substr("test this one.", 1, 1)),"", LOWER(SUBSTR("test this one.", 2, length("test this one."))));
$food = array(
'fruits' => array('', '', ''),
'veggie' => array('', '', ''),
"test" => ""
);
//set the empty count to 0
$countEmpty = 0;
//set number of keys count to 0
$countKey = 0;
foreach($food as $key => $val) {
if(is_array($val)) {
//loop through each values inside
foreach($val as $key1 => $val1) {
$val = trim($val);
if(empty($val1)) {
//empty value-- increment the empty value count
$countEmpty++;
}
//increment the key count
$countKey++;
}
}
else {
$countKey++;
$val = trim($val);
if(empty($val)) {
$countEmpty++;
}
}
}
if($countKey == $countEmpty) {
echo "Array is empty..!";
}
else {
echo "Array contains".($countKey - $countEmpty)." value(s)";
}
echo "
";
echo "Keys:".$countKey."
";
echo "Empty:".$countEmpty;
?>