Reputation: 837
Basically I want to do a php loop that base64_encodes its self 5 times.
//For example
i want to encode "test" which is "dGVzdA=="
then we encode "dGVzdA==" which is "ZEdWemRBPT0="
then encode "ZEdWemRBPT0=" which is "WkVkV2VtUkJQVDA9"
I can't figure out how to create a loop that modifies its self each time it runs.
// this is what i had
function enloop($dowork){
for ($i=1; $i<=5; $i++)
{
return base64_encode($dowork);
}
}
enloop($code);
THIS SCRIPT just repeats the encode 5 times, lets say your encodign the word test for example the output would be dGVzdA==dGVzdA==dGVzdA==dGVzdA==dGVzdA==
this is not what i want.
Upvotes: 0
Views: 125
Reputation: 254926
function enloop($dowork)
{
for ($i = 1; $i <= 5; $i++)
{
$dowork = base64_encode($dowork);
}
return $dowork;
}
enloop($code);
Upvotes: 5