Hello! 🙂
Here's the thing. During next week, I'll be writing a school-project on encryption, which means the teacher will hand me an encrypted text and tell me to figure out what the original message was
As you may have guesssed already, that'll require an awful lot of systematic approach and testing, which I've tried doing it manually in Microsoft Word, but that's just not working properly and effective enough, and there's a rather high chance of failing at some point
I've been interested in PHP and website-coding a few years back, and thought today that it might come in handy just now! Although, seeing as it has been quite a few years since I coded anything last, I'd love some help coding this tool, or even better, working scripts
The idea was, that if I had a text consisting of like 1000 random letters, shortened down to 15 for illustration, I could pop the text in a HTML text box, and let PHP do the work
The result should be something like this
My random encrypted text: ABCDEFGHIJKLMNO
The PHP script should then split it up and print it out in a number of rows, chosen by me
If I want three rows, the result should be:
Row1: A D G J M
Row2: B E H K N
Row3: C F I L O
If I chose 5 rows, it would be
Row1: AFK
Row2: BGL
Row3: CHM
Row4: DIN
Row5: EJO
I figured I could use the functions str_split(); to split up the encrypted text, and then some sort of $i = 0, print variable, $i += (some chosen number, eg. 3 or 5 as above)
I found this small script, the idea is the same, except I want to decide the number $i, and I want it to work with letters, so count(); probably doesn't work
for ($i = 0; $i < count($array1); $i += 2)
echo $array1[$i];
Perhaps array_filter(); somehow?
I'd really love some help, thanks in advance
Skodborg