我尝试在PHP中循环,但它没有工作
重复字符串,直到达到消息的长度。
答案 0 :(得分:0)
这是代码
private function initiate_encryption() // BREAKING DOWN THE MESSAGE INTO ARRAY
{
for($a = 0; $a < count($this->raw_message); $a ++)
{
$this->raw_msg_brkdown[$a] = array_search($this->raw_message[$a],$this->set); // ASSIGNING DATA TO ARRAY ACCORDING TO ALP
}
return $this->mix_passprase();
}
private function mix_passprase() // BREAKING DOWN THE PASSPHRASE INTO AN ARRAY AND ASSIGNING VALUE
{
for($a = 0; $a < count($this->passphrase); $a ++)
{
$this->raw_pass_brkdown[$a] = array_search($this->passphrase[$a],$this->set); // ASSIGNING DATA TO ARRAY ACCORDING TO ALP
}
return $this->mix_elements();
}
private function mix_elements() // THE MOMENT OF TRUTH
{
$str = count($this->raw_message);
$pass = count($this->passphrase);
for($a = 0; $a < $pass; $a += $str)
{
echo $a;
}
}