Need help with a small PHP project
Posted: Mon Dec 13, 2010 5:51 pm
I wish to create a php application which takes an array of set charaters eg. ! £ $ % ^ & and randomly places them infront of every word in a sentence.
So "This is an example" ... would become "£This !is $an ^example"
I have already found an article that explains adding characters http://www.canbal.com/view.php?sessioni ... 2BqRbak%3D
And so far have the basics of:
The bit i'm stuck on is trying to get insert the random characters.
Would appreciate any help
So "This is an example" ... would become "£This !is $an ^example"
I have already found an article that explains adding characters http://www.canbal.com/view.php?sessioni ... 2BqRbak%3D
And so far have the basics of:
Code: Select all
$my_array = array("!", "£", "$", "%", "^", "&");
$str = 'This is an example of a sentence';
$str = $random . implode(' ' . $random ,explode(' ',$str));Would appreciate any help