Hi guys! I'm new to PHP but i'm writing this script. This is what I "WANT" it to do >
I want to have it execute 1 thing in array 1 randomly if the hour of the day is let's say X.
And if that time of day is not X, then I want it to execute a quote from another array, let's say array 2.
------------------------------------------------------------------------------
2 author's of the quote system, and basically every other hour of the day I want it to switch between the arrays. Each array is just a collection of quotes by these 2 authors. Okay well it doesn't work... So i've included it here > to go look at it's a txt doc >
http://www.trickstutorials.com/randomquote.txt
Just tell me what's wrong with it, I think it's simple I'm just not picking up on it guys. Thanks in advance! I'd really appreciate some help on this guys! PHP ROX!!
Random Quote + Time Variable
Moderator: General Moderators
Re: Random Quote + Time Variable
how about you assign all odd numbers of the day for array 1
and all even numberes of the day for array 2
you can use the modulus operator (%) to check whether the hour is odd or even
so say like its 12pm. you would do something like this
err hope that helps, i'm a newbie like you 
and all even numberes of the day for array 2
you can use the modulus operator (%) to check whether the hour is odd or even
so say like its 12pm. you would do something like this
Code: Select all
$check_time = $hour % 2;
if ($check_time == 0)
{
// output quote from array 1
}
else
{
// output quote from array 2
}OH MY GOD!
I COULD KISS YOU! I've been trying for 2 days lol!! THANK YOU SO MUCH BITCH HAHAH!! YOU KICK ASS THANKS SO MUCH!!! I COULD HUG YOU BUT I DOn'T KNOW YOU 