I have the below line working fine, it only replaces the text if host is assign nothing:
$content = str_replace("host = ''", "host = 'test1'", $content);
I'm trying to use preg_replace to always replace the host value even if its not null with something like:
$content = preg_replace ('/\host\=\'(.*?)\](.*?)\'/is', 'host\=\'test1\'', $content);
$content = str_replace("host = ''", "host = 'test1'", $content);
I'm trying to use preg_replace to always replace the host value even if its not null with something like:
$content = preg_replace ('/\host\=\'(.*?)\](.*?)\'/is', 'host\=\'test1\'', $content);