Random Sentences - Question
Posted: Tue May 18, 2010 10:36 am
Can somebody post a little php snippet for this?
I have a textfile like this:
I {love|like|need} {coffee|tea}.
He is {cool|nice|awesome} {.|..|!}
Are you {hungry|tired|angry}?
The little php snippet should select one line of the textfile at random and create a random sentence from it, every time i start the php-script.
Example:
After starting the script, it selects line 1: "I {love|like|need} {coffee|tea}."
Then it creates a random sentence like "I like tea." or "I love coffee." (or something like this) from it.
I have a textfile like this:
I {love|like|need} {coffee|tea}.
He is {cool|nice|awesome} {.|..|!}
Are you {hungry|tired|angry}?
The little php snippet should select one line of the textfile at random and create a random sentence from it, every time i start the php-script.
Example:
After starting the script, it selects line 1: "I {love|like|need} {coffee|tea}."
Then it creates a random sentence like "I like tea." or "I love coffee." (or something like this) from it.