Skip to content

Instantly share code, notes, and snippets.

@RandomArray
Last active August 29, 2015 14:27
Show Gist options
  • Save RandomArray/27298c0c09b69a5f6599 to your computer and use it in GitHub Desktop.
Save RandomArray/27298c0c09b69a5f6599 to your computer and use it in GitHub Desktop.
A Random Array of Random
<?php
// A Random Array of Random
FUNCTION R(){$N=0;FOR($I=1;$I<=64;$I++){$N.=rand(0,1);}
RETURN $N;}FOR($I=1;$I<=RAND(0,16);$I++){$A[R()]=R();}
print_r($A);
// http://sandbox.onlinephpfunctions.com/code/271c6c02aa703dca78ae00d8a00da4aae7181baa
?>
@RandomArray
Copy link
Author

PHP Sandbox Link:
http://sandbox.onlinephpfunctions.com/code/271c6c02aa703dca78ae00d8a00da4aae7181baa

** Example Output **

Array
(
    [00000010111010010010011111010110111100100101101100010100111100010] => 01100001001110110110101010011011000011110111111011011111001101101
    [01100000011011100000000010000101001111111011111010010100001011110] => 01011000000011010000101110010010101100101010111010111011100100000
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment