Mapper::normalize PHP Method

normalize() public static method

public static normalize ( $url )
    public static function normalize($url)
    {
        if (!self::isExternal($url)) {
            $url = preg_replace('%/+%', '/', $url);
            $url = '/' . trim($url, '/');
        }
        return $url;
    }

Usage Example

Example #1
0
 public static function write($name, $value, $expires = null)
 {
     $self = self::getInstance();
     $expires = $self->expire($expires);
     $path = Mapper::normalize(Mapper::base() . $self->path);
     return setcookie($self->name . '[' . $name . ']', self::encrypt($value), $expires, $path, $self->domain, $self->secure);
 }
All Usage Examples Of Mapper::normalize