Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $waf_patterns = [ '/[A-Za-z0-9]+/i', '/system|exec|passthru|shell_exec|assert|eval|base64_decode|gzuncompress|c all_user_func|call_user_func_array|`/i', '/\./', '/chr\s*\(/i', '/\^/', '/\+\+/', '/\\\\x[0-9a-f]{2}/i', '/%[0-9a-f]{2}/i', '/\$/', ]; $allVisibleChars = range(32, 126); $notFilteredChars = []; foreach ($allVisibleChars as $charCode) { $char = chr($charCode); $matched = false; foreach ($waf_patterns as $pattern) { if (preg_match($pattern, $char)) { $matched = true; break; } } if (!$matched) { $notFilteredChars[] = $char; } } if (empty($notFilteredChars)) { echo "所有字符都被正则表达式过滤了。\n"; } else { echo "以下字符没有被正则表达式过滤:\n"; foreach ($notFilteredChars as $char) { echo $char . " "; } echo "\n"; }
Copy Clear