Beispiel #1
0
	/**
	 * Test mb_strip_accents method.
	 * Equal value is considered valid.
	 */
	public function testStripAccents() {
		$accents = 'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåçèéêëìíîïñòóôõöøùúûüýÿĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıĴĵĶķĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŌōŎŏŐőŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƒƠơƯưǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǺǻǾǿ';
		$noaccts = 'AAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaceeeeiiiinoooooouuuuyyAaAaAaCcCcCcCcDdDdEeEeEeEeEeGgGgGgGgHhHhIiIiIiIiIiJjKkLlLlLlLlllNnNnNnnOoOoOoRrRrRrSsSsSsSsTtTtTtUuUuUuUuUuUuWwYyYZzZzZzsfOoUuAaIiOoUuUuUuUuUuAaOo';
		$stripped_accents = mb_strip_accents($accents);
		$this->assertEquals($noaccts, $stripped_accents);
	}
Beispiel #2
0
 function mb_string_url($string, $to_lower = true)
 {
    $string = mb_strtolower($string);
    $string = mb_strip_accents($string);
    $string = preg_replace('@[^a-z0-9]@',' ',$string);
    $string = preg_replace('@\s+@','-',$string);
    return $string;
 }