Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for phpPlatonLib/common/str/Attic/fnc.append_slash.php between version 1.1 and 1.2

version 1.1, 2002/04/19 23:58:05 version 1.2, 2002/04/20 22:59:50
Line 8 
Line 8 
  * On success returns changed string, on failure returns false;   * On success returns changed string, on failure returns false;
  */   */
   
 function append_slash($string)  function append_slash($string, $char = '/')
 {  {
         if (! is_string($string))          if (! is_string($string) || ! is_string($char))
                 return false;                  return false;
   
         if(strlen($string) > 0) {          if (strlen($string) > 0) {
                 if ($string[strlen($string) - 1] != '/')                  if ($string[strlen($string) - 1] != $char[0])
                         $string .= '/';                          $string .= $char[0];
         }          }
   
         //return false;  
         //return '';  
         return $string;          return $string;
 }  }
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top