7-Views - Page 4 of 6 - Developers Blog

count(): Parameter must be an array or an object that implements Countable

Posted by
October 16, 2018

count() throws a warning since PHP 7.2 in case a scalar or non-countable object is passed. We rely on this behavior in many places so code needs to be adjusted. More info https://wiki.php.net/rfc/counting_non_countables http://php.net/manual/en/function.count.php   Here is my solution for this. function count_array($aArr) { if (is_array($aArr)) { return count($aArr); } else { return 0; } } […]

read more

Email Validation

Posted by
September 13, 2018

function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@”]+(\.[^<>()\[\]\\.,;:\s@”]+)*)|(“.+”))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); }  

read more