Blame | Last modification | View Log | Download | RSS feed
<?php
/*
* Revision History:
* 20170706 RWR
* Created
*/
include_once( './license_database.php' );
/* function will take all eoln ("\n") and convert to <br /> if $makeHTML
* is true, otherwise will replace all <br /> with \n.
* Will then remove duplicates IF THEY ARE EXACTLY NEXT TO EACH OTHER
* ie, with no intervening spaces.
*/
function cleanLineReturn ( $subject, $makeHTML = false ) {
if ( $makeHTML ) {
$search = "\n";
$replace = "<br />";
} else {
$search = "<br />";
$replace = "\n";
}
$subject = str_replace ( $search, $replace, $subject );
return str_replace ( $replace . $replace, $replace, $subject );
} // cleanLineReturn
function removeBlankLines( $subject, $eoln = "\n" ) {
return preg_replace( '/^[ \t]*[\r\n]+/m', '', $subject );
}
?>