function filterData(Array $in) {
foreach ($in as $key => $value) {
if (is_array($value)) {
filterData($in[$key]);
} else {
$value = trim($value);
$value = strip_tags($value);
$value = htmlspecialchars($value);
$in[$key] = $value;
}
}
return $in;
}
$cleanArray = filterData( json_decode($arr, true) );
var i;
for (i = 0; i < 10; i++)
document.write(i);
alert(i);
//User model
public function checkEmail($email) {
$data = [
'email' => $email
];
$sql = "SELECT `id` FROM `$this->table` WHERE `email` = :email";
return $this->model->getCount( $sql, $data );
}
//Base model
public function getCount($sql, Array $args) {
$stmt = $this->connection->prepare($sql);
if ( $stmt->execute($args) ) {
return $stmt->rowCount();
}
return false;
}