Created
January 25, 2019 23:14
-
-
Save parzibyte/4ead82e2c7f9fee255018f194c405f34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$salida = "index.html"; | |
ob_start(); | |
include_once "index.php"; | |
# ¿Expresiones regulares? ¿Optimización? aquí no hacemos eso.png | |
$contenido = ob_get_clean(); | |
$contenido = str_replace("\n", "", $contenido); | |
$contenido = str_replace("\t", "", $contenido); | |
$contenido = str_replace("\t\t", "", $contenido); | |
$contenido = str_replace(" ", "", $contenido); | |
$escrito = file_put_contents("index.html", $contenido); | |
if ($escrito !== FALSE) { | |
echo "Contenido generado y guardado en $salida"; | |
} else { | |
echo "Eror escribiendo en $salida"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment