Oz needs Help!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ozulloa
Forum Newbie
Posts: 5
Joined: Fri Aug 14, 2009 9:18 am

Oz needs Help!!!

Post 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!
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

Re: Oz needs Help!!!

Post 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
Post Reply