prepare(" SELECT t.*, t.paragraph1, tc.category_name, u.username as creator FROM tests t LEFT JOIN test_categories tc ON t.category_id = tc.id JOIN users u ON t.created_by = u.id WHERE t.id = ? "); $test->execute([$test_id]); $test = $test->fetch(); if (!$test) { header('Location: practice_tests.php'); exit; } // ✅ Word count from paragraph1 $words = preg_split('/\s+/', $test['paragraph1'] ?? ''); $words = array_filter($words, fn($w) => trim($w) !== ''); $wordCount = count($words); ?> 📝 <?= htmlspecialchars($test['title'], ENT_QUOTES, 'UTF-8') ?>

Category: Words:
✅ Total Words:
← Back to Practice