First of all, I apologize for not knowing all the technical terms. The code below is what I'm using to write to a file which is then shown on a very simple chat I've made. I want URL's to automatically be converted to clickable hyperlinks. I've found many snippets of code to make this happen but have no idea how to implement them into my code or which one is the right choice. Thanks for any help
<?php
if (isset($_POST["submit"]) && $_POST["message"] != "") {
date_default_timezone_set("America/Los_Angeles");
$txt = "
<span class=\"date\">Captain's Log - Stardate: ". date("njy @ giA") ."</span><br/>"
. stripslashes(nl2br($_POST["message"])) . "<br/>"
. "<div class=\"line\"></div>
";
$file_data = "$txt";
$file_data .= file_get_contents('txt.txt');
file_put_contents('txt.txt', $file_data);
}
?>