I am having problems with PHP I had to reinstall apache and php and MySQL and this code worked great but now that I reinstalled its giving me this error
Notice: Undefined variable: out in G:\file server\SERVER\server\admin\index.php on line 51
$title = $_POST['title'];
$post = addslashes($_POST['text']);
function nl2p($str) {
$arr=explode("\n",$str);
for($i=0;$i<count($arr);$i++) {
if(strlen(trim($arr[$i]))>0)
$out.='<p>'.trim($arr[$i]).'</p>';
}
return $out;
}
$post = nl2p($post);
but this is for adding a post to a blog thing I'm trying to build however when I got to edit one with this exact same function it works. What's wrong?