Add function minizeHTMLString()

This commit is contained in:
Joshua Ramon Enslin 2020-10-21 21:16:18 +02:00 committed by Stefan Rohde-Enslin
parent 087b4a128e
commit 711bd49048
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -340,4 +340,20 @@ final class MD_STD {
}
/**
* Function for minimizing HTML, trimming each line.
*
* @param string $input Input.
*
* @return string
*/
public static function minimizeHTMLString(string $input):string {
$input = \explode(PHP_EOL, $input);
$output = "";
foreach ($input as $line) $output .= \trim($line) . PHP_EOL;
return $output;
}
}