Bearing in mind the possible homework nature of this question and going on mostly blind optimism that he really does want some tips and not a solution:
- Use split to seperate the words. You probably want to split on a space and then disregard punctuation somehow, either delete it entirely or remove it and then restore at the end
- foreach word in the list you got from split, use substr to find the first letter
- You can then append data by using either the contecate operator: . or just double quotes in the form: $variable="${variable}new_data";, but this case is tailor made for using the appending form of the contecate operator
- Assemble the list of words back together again, restore punctuation and you have yer sentence.