Page 1 of 1

Oz needs Help!!!

Posted: Sun Nov 01, 2009 5:31 pm
by ozulloa
I need help creating a page that will accept 2 words (strings) and will display a new word using the letters of the first and second word. it will interscalate the letter using all letter from the first word going forward and of the second one in the opposite direction. something like>

1st word: dog
2nd word: cat
new word: dtoagc

the two words that the user will enter are obtained from a textbox and it will be printed in a table>

first word >>>second word>>>new word

hope it makes sense!

thanks for your help!

Re: Oz needs Help!!!

Posted: Sun Nov 01, 2009 5:42 pm
by Monotoko
This should reverse your word:

Code: Select all

echo implode(' ', array_map('strrev', explode(' ', $string)));
but i would assume that in order to merge the words, you would have to break it down into an array, do this using the explode function:
http://php.net/manual/en/function.explode.php