Código HTML:
<p><span style="color: rgb(128, 128, 0);">This</span> is <span style="color: rgb(255, 204, 153);">some</span> <strong>sample text</strong>. You <span style="color: rgb(204, 255, 204);">are</span></p>
Código PHP:
echo $variable;
Mi pregunta surge cuando quiero crear un html y quiero poner el valor de esa variable, lo hago tal que asi:
Código PHP:
$xml.="<html><head><title></title></head>";
$xml.="<body>".$variable."</body></html>";
$sfile="productos.html";
$fp=fopen($sfile,"w+");
fwrite($fp,$xml);
chmod("$sfile", 0777);
fclose($fp);
Código HTML:
<html><head><title></title></head> <body> <p><span style="color: rgb(128, 128, 0);">This</span> is <span style="color: rgb(255, 204, 153);">some</span> <strong>sample text</strong>. You <span style="color: rgb(204, 255, 204);">are</span></p> </body></html>
Código HTML:
<html><head><title></title></head> <body> <p><span style="color: rgb(128, 128, 0);">This</span> is <span style="color: rgb(255, 204, 153);">some</span> <strong>sample text</strong>. You <span style="color: rgb(204, 255, 204);">are</span> using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p> </body></html>
¿Como puedo conseguir que me lo escriba de la anterior forma?
Muchisimas gracias por adelantado.