Subversion Repositories computer_asset_manager_v1

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
41 rodolico 1
<?php
2
   /*
3
    * Revision History:
4
    * 20170706 RWR
5
    * Created
6
    */
7
 
8
   include_once( './license_database.php' );
9
 
10
   /* function will take all eoln ("\n") and convert to <br /> if $makeHTML
11
    * is true, otherwise will replace all <br /> with \n.
12
    * Will then remove duplicates IF THEY ARE EXACTLY NEXT TO EACH OTHER
13
    * ie, with no intervening spaces.
14
    */
15
 
16
   function cleanLineReturn ( $subject, $makeHTML = false ) {
17
      if ( $makeHTML ) {
18
         $search = "\n";
19
         $replace = "<br />";
20
      } else {
21
         $search = "<br />";
22
         $replace = "\n";
23
      }
24
      $subject = str_replace ( $search, $replace, $subject );
25
      return str_replace ( $replace . $replace, $replace, $subject );
26
   } // cleanLineReturn
27
 
28
 
29
   function removeBlankLines( $subject, $eoln = "\n" ) {
30
      return preg_replace( '/^[ \t]*[\r\n]+/m', '', $subject );
31
   }
32
 
33
 
34
 
35
?>