-4

I am using a piece of code to show the city output. It is working fine. The code is given here:

$city = get_comment_meta( get_comment_ID(), 'city', true );

I want to show Re: text before the output of above code.

4
  • If you just want to add a string it would be $city = "Re: " . get_etcetera.. Else I don't know what you are trying to achieve.
    – cjbj
    Jun 28, 2016 at 18:20
  • 1
    Great that helped. I've included it as an answer. Pleas accept it, so this question does not pop up later as "unsolved":
    – cjbj
    Jun 30, 2016 at 7:25
  • @cjbj this will in all probability be closed, need one close vote to close this as off topic as it is generic PHP. Also note, a question is considered answered when it has an upvoted answer. It is always much better to have an accepted answer, but a question do not need an accepted answer to be considered answered by the system Jul 1, 2016 at 7:01
  • 1
    @PieterGoosen I know. But I also know we have a large close-vote-backlog, so I follow both paths.
    – cjbj
    Jul 1, 2016 at 7:09

1 Answer 1

3

If you just want to add a string it would be:

$city = "Re: " . get_comment_meta( get_comment_ID(), 'city', true ); 

Not the answer you're looking for? Browse other questions tagged or ask your own question.