1.Open new document
Open new document, Write any word.
After that open an image.
2.Process
Copy the image.
Now, press Ctrl + Click on thumbnail of text layer, So you’ll have a dotted line around the word.
3.Final step
Go to Edit > Paste special > Paste into. You’ll have a text with background like this.
You can change the size of image by Ctrl + T.