URLify::add_chars PHP Method

add_chars() public static method

Add new characters to the list. $map should be a hash.
public static add_chars ( $map )
    public static function add_chars($map)
    {
        if (!is_array($map)) {
            throw new LogicException('$map must be an associative array.');
        }
        self::$maps[] = $map;
        self::$map = array();
        self::$chars = '';
    }

Usage Example

Example #1
0
 function test_add_chars()
 {
     $this->assertEquals('¿ ® ¼ ¼ ¾ ¶', URLify::downcode('¿ ® ¼ ¼ ¾ ¶'));
     URLify::add_chars(array('¿' => '?', '®' => '(r)', '¼' => '1/4', '¼' => '1/2', '¾' => '3/4', '¶' => 'P'));
     $this->assertEquals('? (r) 1/2 1/2 3/4 P', URLify::downcode('¿ ® ¼ ¼ ¾ ¶'));
 }
All Usage Examples Of URLify::add_chars