Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Ordered list
The codemaker must generate a four digit code, keeping the order of digit. It will be convenient to find a programming structure which can do so.
Hints
Here are some hints, but you really should try to find by yourself.
Click to see some hints
To store ordered list of string, items, or number, you can use PHP associative arrays:
Solution
Click to see a way to implement it
1
2
3
4
<?php
$mysteryArray = [4, 1, 3, 2];
var_dump($mysteryArray);
Enter to Rename, Shift+Enter to Preview
1
2
3
4
<?php
$mysteryString = implode([1, 2, 3, 4]);
var_dump($mysteryString);
Enter to Rename, Shift+Enter to Preview
1
2
3
4
<?php
$newMysteryArray = str_split("1234");
var_dump($newMysteryArray);
Enter to Rename, Shift+Enter to Preview
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content