I would like a way to show a random image on my site, but not random each time people refresh the page, but random for each string,
For this I have differents css rules :
.random1, .random2, .random3, …, .random10
Actually I do this:
<div class="random<?= rand(1, 10 ?>">...</div>
But I don’t want this to change at each refresh, so I would like to change for example the 4 first characters of my string (the content of the div) into a number
For example, “Hello” would return “3”, or “In this article …” would return 7.
But I don’t know how to do this ?
Thanks