Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $article = "hello <a href='http://www.someotherwebsite.com'>testlink</a> everyone" ;
- $parts = explode(" ", $article);
- $randomamount = count($parts);
- $hit = rand(0, $randomamount);
- if(isset($_SESSION['last'])) {
- // already seen?ok
- if($hit == 0) {
- $hit=$hit+1;
- } else {
- $hit=$hit-1;
- }
- }
- $_SESSION['last']=$hit;
- echo $parts[$hit];
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement