Hello,
When I echo my articles on a webpage I need to set random style to them, to do so I need to add random class to my <div>
This is what I've got so far
Then I echo $storyDisplayLi st somewhere on my page to show articles. I thought that by random class to <div> in StoryDisplayLis t I could set different styles, but instead of giving it a random class of story_style1 it gives it a class of 0 or sometimes array.
Does anyone here has any idea of how can I fix it.
When I echo my articles on a webpage I need to set random style to them, to do so I need to add random class to my <div>
This is what I've got so far
Code:
[U]$style_array = array("story_style1", "story_style2", "story_style3", "story_style4");
$rand_style = array_rand($style_array);[/U]
$storyDisplayList .= '<div class="[B]' . $rand_style . '[/B]"></div>
Does anyone here has any idea of how can I fix it.
Comment