It would reall help if you said what you want the palindrome program to do. 🙂 If you just want to make one from a given string, the simplest way is:
$pal = $str . strrev($str);
Of course, there's no guarantee the result will make sense, and it will always be an even number of letters.