Make WordPress Core


Ignore:
Timestamp:
03/10/2007 06:25:33 AM (20 years ago)
Author:
markjaquith
Message:

new function: untrailingslashit(). fixes #3899

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r4990 r5020  
    564564
    565565function trailingslashit($string) {
    566                 if ( '/' != substr($string, -1)) {
     566                if ( '/' != substr($string, -1))
    567567                                $string .= '/';
    568                 }
    569568                return $string;
     569}
     570
     571function untrailingslashit($string) {
     572        return preg_replace('|/+$|', '', $string);
    570573}
    571574
Note: See TracChangeset for help on using the changeset viewer.