Infiere lo que está pasando en cada uno de los componentes del bucle foreach:

foreach ($validation as $key => $value) {

            if ($validation[$key] === 1) {
                $data[$key] = filter_var($data[$key], FILTER_SANITIZE_EMAIL);
            } elseif ($validation[$key] === 3) {
                $data[$key] = preg_replace('/[^\p{L} ]/u', '', $data[$key]);
                $generalSanitization = false;
            } elseif ($validation[$key] === 4) {
                $data[$key] = preg_replace('/[^0-9]/', '', $data[$key]);
                $generalSanitization = false;
            } elseif ($validation[$key] === 5) {
                $data[$key] = preg_replace('/[^\p{L}\p{Nd}\s]/u', '', $data[$key]);
                $generalSanitization = false;
            } elseif ($validation[$key] === 6) {
                $data[$key] = preg_replace('/[^\p{L}\p{Nd}\s[:punct:]¡¿]/u', '', $data[$key]);
            } elseif ($validation[$key] === 7) {
                $data[$key] = preg_replace('/[^\p{L}\p{Nd}\s[:punct:]¡¿\x20-\x7F]/u', '', $data[$key]);
            } elseif ($validation[$key] === 8) {
                $data[$key] = preg_replace('/[^\x20-\x7F]/', '', $data[$key]);
            } elseif ($validation[$key] === 9) {
                $data[$key] = preg_replace('/^([a-zA-Z0-9_-]+)([^a-zA-Z0-9_-]+).*$/', '$1', $data[$key]);
            }

            if ($generalSanitization === true) {
                $data[$key] = Sanitization::string($data[$key], $databaseConnection);
            }
        }
Infiere lo que está pasando en cada uno de los Componentes del bucle foreach: foreach ($validation as $key => $value) { if ($validation[$key] === 1) { $data[$key] = filter_var ($ข้อมูล[$คีย์], FILTER_SANITIZE_EMAIL); } elseif ($การตรวจสอบความถูกต้อง[$คีย์] === 3) { $data[$key] = preg_replace('/[^\p{L} ]/u', '', $data[$key]); $generalSanitization = เท็จ; } elseif ($การตรวจสอบความถูกต้อง[$คีย์] === 4) { $data[$key] = preg_replace('/[^0-9]/', '', $data[$key]); $generalSanitization = เท็จ; } elseif ($validation[$key] === 5) { $data[$key] = preg_replace('/[^\p{L}\p{Nd}\s]/u', '', $data [$คีย์]); $generalSanitization = เท็จ; } elseif ($validation[$key] === 6) { $data[$key] = preg_replace('/[^\p{L}\p{Nd}\s[:punct:]¡¿]/u ', '', $data[$key]); } elseif ($validation[$key] === 7) { $data[$key] = preg_replace('/[^\p{L}\p{Nd}\s[:punct:]¡¿\x20- \x7F]/u', '', $data[$key]); } elseif ($การตรวจสอบความถูกต้อง[$คีย์] === 8) { $data[$key] = preg_replace('/[^\x20-\x7F]/', '', $data[$key]); } elseif ($การตรวจสอบความถูกต้อง[$คีย์] === 9) { $data[$key] = preg_replace('/^([a-zA-Z0-9_-]+)([^a-zA-Z0-9_ -]+).*$/', '$1', $data[$key]); } if ($generalSanitization === true) { $data[$key] = Sanitization::string($data[$key], $databaseConnection); } }
spam lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor creativity violence