I have a quick question. I know that the cakePHP find ('first') function returns an array containing the first result, if found, false otherwise. My question is, if I have to write a check, for example:
if(result_is_array) // that means I have data { // do something } else // that means result is a boolean { // do something else }
Instead of checking if the result from find('first') array or not, can I just say:
$result = $this->MyModel->find('first'); if($result) {
In the case of words, if I get the array here, will it be evaluated using TRUE in php? Is if(array()) equal to TRUE in php?
source share