79674504

Date: 2025-06-21 14:31:29
Score: 1
Natty:
Report link
<?php
function stringToRandomClass($str, $max = 10) {
    $hash = crc32($str);
    $number = ($hash % $max) + 1;
    return "random$number";
}

$content = "Hello";
$randomClass = stringToRandomClass(substr($content, 0, 4));
?>

<div class="<?= $randomClass ?>"><?= htmlspecialchars($content) ?></div>
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: bhushan todkar