Php Random Titles - Learn to create neat-o random titles!

Pages: 1, 2
free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > Tutorials

Php Random Titles - Learn to create neat-o random titles!

KansukeKojima
Oh yeah.... I just remembered..... you can also do this with switches... or cases whatever they're called.


CODE
$random_message = rand(1, 6);
switch ($random_message) {
    case 1;
        $rand = 'BLA BLA BLA BLA BLA.... ';
        break;
    case 2;
       $rand = 'BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... ';
        break;
    case 3;
       $rand = 'BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... ';
        break;
    case 4;
        $rand = 'BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... ';
        break;
    case 5;
        $rand = 'BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... ';
        break;
    case 6;
        $rand = 'BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... BLA BLA BLA BLA BLA.... ';
        break;
}

echo $rand;

 

 

 


Reply

hippiman
There are a lot of tutorials on how to randomize things with php.

Why do they need so many? Why couldn't someone just post a couple of the functions like random(), and a tutorial on arrays, and let people figure out, "Hey, maybe if I put a random number in an array of strings, I could have it use that as the title, then I would have a random title!"

There have been tutorials on having random images, and random titles, and many others, and they're all pretty much exactly the same.

To me, it just seems like wasted space, and when you're trying to actually figure something out, you have a lot more code to look through because of all the ways people find to do the same thing.
They should only make a new post if it's actually new code, or it's really innovative, and not something someone could easily figure out.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Recent Queries:-
  1. php random letter exclude - 44.92 hr back. (1)
  2. use php forms - how many radial buttons checked variable - 56.63 hr back. (1)
  3. decrease fsockopen timeout - 74.49 hr back. (1)
  4. how to make random titles in html - 84.94 hr back. (1)
  5. random titles - 2.73 hr back. (2)
Similar Topics

Keywords : php, random, titles, learn, create, neat, o, random, titles

  1. Nice Clean Php Layout Coding.
    Learn a nice neat way to code your layouts with php (7)
  2. Php - Randomize Web Title
    using arrays and the random function (5)
    PHP - Randomize Web Title with the rand function... Define the variables numbers we start at number
    0 CODE <?php $title[0] = "Web title 0"; // Title 0
    $title[1] = "Web title 1"; // Title 1 $title[2] = "Web title
    2"; // Title 2 $title[3] = "Web title 3"; // Title 3
    $title[4] = "Web title 4"; // Title 4 ?> now we use the rand()
    function to get a randomize the web title. rand(0, 4) means we start at 0 and end at 4 i can get
    0,1,2,3,4 one of those. ....
  3. Random Quote Script
    (6)
    Here's a little random quote script that you can use to randomly choose from an array of quotes
    you provide. It's very easy to use on any page as it's an external script, you just call it
    from your page. I wouldn't use it for any more than about 50 quotes though, it would probably
    slow your site down too much. Here's the code: var ar = new Array(44) ar = "Do not meddle in
    the affairs of wizards, for they are subtle and quick to anger." ar = "Faithless is he that says
    farewell when the road darkens." ar = "I cordially dislike allegory in all its ....

    1. Looking for php, random, titles, learn, create, neat, o, random, titles

Searching Video's for php, random, titles, learn, create, neat, o, random, titles
advertisement



Php Random Titles - Learn to create neat-o random titles!



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE