Imagine you have the following array of integers:
array(1, 2, 1, 0, 0, 1, 2, 4, 3, 2, [...] );
The integers go on up to one million entries; on
I can't randomly generate it every time because it should be consistent and always have the same values at the same indexes.
Have you ever read up on pseudo-random numbers? There's this little thing called a seed which addresses this issue.
Also benchmark your options and claims. Have you timed the file_get_contents vs. the json_decode? There is a trade-off to be made here between storage and access costs. Eg. if your numbers are 0..9 (or 0..255) then it may be easier to store them in a 2Mb string and use an access function on this. 2Mb will load faster whether from the FS or APC.