Coding Spinner Text used php

Discussion in 'PHP' started by inrev, Mar 14, 2011.

  1. #1
     <?php
    $text = "Digitalpoint.com is {the best forum|a great Forum|a wonderful Forum|a perfect Forum} {code|script}";
    $words = explode("{",$text);
    foreach ($words as $word)
    {
        $words = explode("}",$word);
        foreach ($words as $word)
        {
            $words = explode("|",$word);
            $word = $words[array_rand($words, 1)];        
            echo $word." ";
        }
     
    }
    ?>
    PHP:

     
    inrev, Mar 14, 2011 IP