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 Quote 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 Quote 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 . Quote 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>'; Quote Link to comment https://forums.phpfreaks.com/topic/206901-random-href-class/#findComment-1081972 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.