Welcome Guest ( Log In | Register)



2 Pages V  < 1 2  
Reply to this topicStart new topic
> Php Random Titles, Learn to create neat-o random titles!
KansukeKojima
post Jan 29 2008, 09:00 PM
Post #11


Privileged Member
*********

Group: [HOSTED]
Posts: 528
Joined: 13-October 06
From: Alberta, Canada
Member No.: 31,584



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;
Go to the top of the page
 
+Quote Post
hippiman
post Jan 30 2008, 03:09 AM
Post #12


Premium Member
********

Group: Members
Posts: 150
Joined: 9-April 07
From: Nebraska
Member No.: 41,301



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.
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. where did you learn html from?(85)
  2. How To Create Virtual Drives(20)
  3. How To Create A Forum?(18)
  4. How Can I Create A Gui Using C++(5)
  5. How To Create Java Button Or Frame(14)
  6. Signature Tutorial(25)
  7. How To Create Embed Image Mail In Gmail(54)
  8. Private Server Ro .(158)
  9. Wanting To Touch Up/learn My Html Again(27)
  10. Learn To Fly(13)
  11. Own Server(9)
  12. Toufee.com - Create Free Flash Movies Online(3)
  13. Where/how Did You Learn Css?(36)
  14. Three Neat Avatar-based Sites(7)
  15. How To Create Smallest Website(21)
  1. Learn Html Quick And Easy(14)
  2. How To Create A Photoshop Vortex(12)
  3. How To Create A Song In Fruity Loops Using Vanguard(1)
  4. Where Is There A Good Site To Learn Web Html?(20)
  5. What Is Your Dream Naruto Character(16)
  6. Cool Site To Learn Languages(6)
  7. [help]create P Server(2)
  8. Phpmyadmin(7)
  9. A Prelude To Programming(10)
  10. Perl Regular Expresions Regex(2)
  11. How To Create A Show Desktop Shortcut(2)
  12. How To Create Cool Image Buttons(7)
  13. How To Create A Torrent(4)


 



- Lo-Fi Version Time is now: 30th August 2008 - 11:14 AM