I've been trying to wrap my head around solving this issue but I can't seem to find a simple solution to it.
I have a dynamic grid layout, articles are placed on the grid but have different width & height. This width & height of these different articles can change upon visiting the site but only when there is a new article added.
The issue is I have logic that uses mt_rand
to generate random numbers within a range (to fit in the layout grid), is there a way I can pass in a seed (planning to use the newest article id) so that the random numbers are consistent until a new article is introduced? I wanted to use mt_srand
but there doesn't seem to be an easy way to limit the random number within a range.
Thanks.