Recently I saw that when I put the link in my profile it replaced it with the exact title of the question. So I want to know, how do they do it?
I am guessing that they do this by sending the link via ajax and then make a link header by php implode ,explode. Is this correct way/same way that Stack Overflow does this?

Suppose I am pasting the above link in the textarea like this
This is what happens behind the scenes. A GET request is made to the below URL
The response of that GET is
From that one could retrieve the title. Hope this helps.