+ 2
Is there a way to make a diffrent text appear, when the page is refreshed?
Alright, so, I want like diffrent questions appearing everytime you go in and out or refresh the page... Not sure if it's possible. Because I had this idea on twitch when you say !question everytime a diffrent question appears, but do that as a mod. Not as the streamer. And if there's a way to make a diffrent text appear once refreshed the page, can you please tell me how? Thanks.
6 Respuestas
+ 1
It can be easily done in js in front end, and any server side language.
For example in js
alert(welcome[Math.floor(Math.random()*welcome.length]));
create an array of text you want to show, then choose random number from 0 to last index. then choose element from array using that random number
btw, delete the double post -> https://www.sololearn.com/Discuss/1613905/
+ 1
In modern high level language, yes array are everywhere. And yes php has array
0
Point is I don't unserstand half of this stuff xd
0
Wait, so the "array" thing is in every language? Because I decided to learn php as it seems easy..
0
Alright, thanks mate,
made the code
you can change the questions if ye want