Check if string has link
This php code can be used to check if string contains link or not. Here, alert is also displayed if string contains link.