this is a PHP Question
i have a function
function myfn () {
where i get some data here and add result to an array $matches = array(); preg_match_all('????????????', $searched, $matches); print_r($matches[1]); }
i need to halt or exit this function if the array contain no elements and send an email to xyz@mail.com
Appreciate your help
Thanks
if you want to exit function just do
return;. But I’d just add some conditional blocks backed withif(). And to check if$matchesarray is empty docount(). So it could all look like this: