manalnor Posted July 6, 2010 Share Posted July 6, 2010 Hello friends, If i've link like this echo "<a href='something.html' class='tag1'>Category</a>"; and i have 2 style classes ( tag1 and tag 2 ) how can i make that link herf code picks random class style of tag1 and tag2 thanks .. it will really helps me alot Link to comment https://forums.phpfreaks.com/topic/206901-random-href-class/ Share on other sites More sharing options...
volatileboy Posted July 6, 2010 Share Posted July 6, 2010 Have a look at the PHP Rand function, this should help you out Link to comment https://forums.phpfreaks.com/topic/206901-random-href-class/#findComment-1081966 Share on other sites More sharing options...
manalnor Posted July 6, 2010 Author Share Posted July 6, 2010 Have a look at the PHP Rand function, this should help you out thanks , i've solved.. i made an array then rand to the array loool thanks alot, your hints given me power to search . Link to comment https://forums.phpfreaks.com/topic/206901-random-href-class/#findComment-1081971 Share on other sites More sharing options...
wildteen88 Posted July 6, 2010 Share Posted July 6, 2010 No need to for an array. The following is more than enough echo '<a href="blah" class="tag'. rand(1,2).'">blahM</a>'; Link to comment https://forums.phpfreaks.com/topic/206901-random-href-class/#findComment-1081972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.