我正在尝试制作一个脚本,该脚本将从字符列表中获取随机变量。我+ &
之前的每封信。这是我到目前为止想出的
<form action="#" method="post">
<input type="text" name="text">
<input type="submit" name="submit">
</form>
<?php
if (isset($_POST['submit'])) {
$str = $_POST["text"];
$arr1 = str_split($str);
foreach ($arr1 as $value)
{
$length = 1;
$chars = '46eab95';
$charslength = strlen($chars);
$randomstring = '';
for ($i = 0; $i < $length; $i++) $randomstring .= substr($chars, rand(0, $charslength - 1), 1);
echo $randomstring;
echo "&" . $randomstring . $value;
}
}
?>
但它只是搞砸了,无法工作,例如,当我试图让它做时,你好,结果是这样的: 6&6h4&4e4&4l6&6l5&5o