Files
attack-defense-platform/services/wanderer/app/application/utils/util.php
T
2025-10-10 22:18:06 +07:00

24 lines
477 B
PHP

<?php
namespace Utils;
class Util {
public function isAlphaNumeric($str){
return preg_match("/^[a-zA-Z0-9]+$/", $str) ? true : false;
}
public function alphaNumeric($str, $default = ''){
return preg_match("/^[a-zA-Z0-9]+$/", $str) ? $str : $default;
}
public function alertExit($str, $back = 1){
echo "<script>alert(`$str`); window.location.href = '/';</script>; if($back) history.back();";
;
exit();
}
}