I want to make a little code that displays a different string everyday.
for example I have 100 strings. I want that when a user opens my site they'll see one of the strings that day. the next day they'll see another string..and so forth.
so far I thought about putting all the strings in array and give every string a hardcoded date on which it will displayed, and then with a simple if statement the correct string is going to be displayed.
is there any known(better) way to do this?
arcticM
Recommended Answers
Jump to Postwhy you not creating database for string u can add it and next day delete all string with one line query and add new string.
Jump to PostYou'll need to store somewhere (in a file perhaps) which array index is the current one, and increase that daily.
All 7 Replies
AARTI SHRIVAS
2
Posting Pro in Training
arcticM
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
arcticM
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
arcticM
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.