愚者樹屋

|
Home About Contact
|

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity

php 切出每個中文字

post date - 2024/09/28
last update - 2024/09/28

最近用來製作模糊搜尋使用的方法,將每個中文字切出後尋找同時有出現這些中文字的資料。

方法

test中文abc會被切成Array ( [0] => test [1] => 中 [2] => 文 [3] => abc ) 存在$matches[0]中

preg_match_all('/([a-zA-Z0-9]+)|\p{Hangul}|\p{Hiragana}|\p{Han}|\p{Katakana}|(\p{Latin}+)|(\p{Cyrillic}+)/u', $str, $matches);

需要其他條件可以在這網站查詢
https://www.regular-expressions.info/unicode.html

參考資料

https://stackoverflow.com/questions/4113802/how-to-split-chinese-characters-in-php

Tags : php

series

3d軟體 (1) apache (1) css (4) eagle (1) godot (8) google-api (1) google翻譯 (1) html (6) hugo安裝 (7) javasciprt (1) javascript (14) jquery (3) mysql (9) notepad++ (1) php (33) python (1) unity (1) yt-dlp (1) 像素畫 (1) 免費軟體 (8) 壓力測試 (2) 弱點掃描修補 (1) 無障礙網站 (1) 社群網站 (1) 遊戲推薦 (5) 雜記 (1)

Tags

2d軟體 3d軟體 ai apache css eagle godot google-api google翻譯 html hugo javasciprt javascript jquery mysql notepad++ php python tcpdf unity

Recent Posts

godot顯示設定

2024/06/15

javascript 時間文字轉yyyymmdd

2024/09/07

陷陣之志(Into the Breach)

2024/02/09

javascript 統一編號檢查

2023/12/17

php pdf旋轉與合併

2022/12/31

mastodon misskey pixiv plurk twitter 巴哈姆特

© 2022-2026 愚者樹屋