Hey guys, being a bit of a novice at PHP I’m struggling with this function.
I want to choose a random word inside the {} to make a different sentence each time I reload my page. The “|” separates each word
I don’t think its a lot of code but could someone help me or point me in the right direction? I was hoping someone had made similar but cant seem to find any php code on the net.
<?php
$text = "The {quick|slow|reasonably paced} {brown|green|blue|pink} {fox|goat|rat|camel}
{jumped|walked|hopped} {over|past|under} the {lazy|tired|boring} {dog|cat|stoat}";
echo Spin($text);
}
?>
just one thing, the text in question was just example… the words outside the {} could be anything. How would i change the code to allow any text? I’m just working through the man to see how it works