How can I convert a link in a text: sdgf sdg https://www.google.ch/ dgsd dfg
Into this: Click here to view the image
Similar to Facebook
try this
$result = preg_replace('/<a href=\"(.*?)\">(.*?)<\/a>/', "\\2", $string);