PHP Modify the return of a loop over and over.
- by Joshua Anderson
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++)
{
returns base64_encode($dowork);
}
}
enloop($code);
//THIS SCRIPT DOES THIS
Repeats the encode 5 times, lets say your encodign the word test for example the output would be dGVzdA==dGVzdA==dGVzdA==dGVzdA==dGVzdA==