Add function minizeHTMLString()
This commit is contained in:
parent
087b4a128e
commit
711bd49048
16
MD_STD.php
16
MD_STD.php
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user