So I will provide this code for example:
$str='<title>Test title here</title><meta name="description" content="test meta content here">';
$jftitle="here title 1";
$jfmeta ="here meta 2";
And I have:
$str=preg_replace(array('/<title>(.*)<\/title>/i','/<meta name="description" content="(.*)">/i'),array('<title>'.$jftitle.'</title>','<meta name="description" content="'.$jfmeta.'">'),$str);
If I do an echo on the $str, it returns ” “.
Can anyone point me in the right direction?
use
echo htmlspecialchars($str);