asunpraise
MIS
Anyone knows what script is like to automatically change a URL to hyperlink so that when a user types a URL in the text field, it changes into hyperlink, like this:
Thanks,
Lea
Thanks,
Lea
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
function add_hypers(&$text) {
$pattern = "/http:\/\/[a-zA-Z.&\-\/]+[a-zA-Z&\-\/]+/";
$formatted_url = "<a href='\${0}'>\${0}</a>";
$text = preg_replace($pattern, $formatted_url, $text);
echo $text;
}
$input = "Hello I have all sorts of things for you to see at [URL unfurl="true"]http://www.google.com.[/URL] please enjoy";
add_hypers($input);
echo "<BR>";
echo $input;
?>