在Laravel中创建UTF-8(波斯)段子

时间:2018-07-10 18:32:56

标签: regex laravel

我写这段代码来创建子弹:

(defn will-print [_ a _ a _ a _ a] (println (str _ a _ a _ a _ a)))
(will-print 1 "a" 2 "b" 3 "c" 4 "last")

除检测半角空格单词外,一切都很好。

例如function create_slug($title, $separator='-') { //Copy from laravel str_slug source (without ascii converter) // Convert all dashes/underscores into separator $flip = $separator == '-' ? '_' : '-'; $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); // Replace @ with the word 'at' $title = str_replace('@', $separator.'at'.$separator, $title); // Remove all characters that are not the separator, letters, numbers, or whitespace. $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title)); // Replace all separator characters and whitespace by a single separator $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); return $title; } 转换为我想要نرم‌افزار的{​​{1}}

نرمافزار用波斯语键盘写一半的空格。

0 个答案:

没有答案