► 2013(3) ► 2012(23)▼ 2011(123)▼ tháng năm(14) ► 2010(35)

10:25
Unknown
No comments
Cách sử dụng:+ bởi vì những vì sao ở trên, mình ý kiến đề xuất bạn yêu cầu chuyển sang dùng nhóm hàm preg_… luôn.+ Sau đấy là một số hàm thuộc nhóm preg_…:
preg_match()– Perform a regular expression match (so sánh)preg_replace()– Perform a regular expression search and replace (tìm kiếm và vắt thế)preg_split()– Split string by a regular expression (tìm kiếm và cắt bỏ)preg_last_error()– Returns the error code of the last PCRE regex executionpreg_match_all()– Perform a global regular expression match
Như vậy sự việc sử dụng các hàm như vậy nào, thì các bạn xem trên:http://www.php.net, Tiếp theo, mình vẫn bàn thêm cách viết các biểu thức định dạng như vậy nào? Tức là: trường hợp viết bởi văn thì là: “4 con số đứng ngay tức thì nhau, rồi mang lại dấu – , rồi cho 2 chữ số, rồi mang lại dấu -, rồi mang đến 2 chữ số nữa” mà lại viết đến php phát âm thì viết như thế nào?
if (preg_match(“/php/”, “PHP is the website scripting language of choice.”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php/i”, “PHP is the website scripting language of choice.”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/^php/i”, “Content PHP is the web scripting language of choice.”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php$/i”, “PHP is the web scripting language of choice. & I choice PHP”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php(s)pro/i”, “PHP pro is the web scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php(s)*pro/i”, “PHP pro is the website scripting language of choice. And I choice PHP”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php(s)+pro/i”, “PHPpro is the website scripting language of choice. Và I choice PHP”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/<_,>php/i”, “_PHP is the web scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php/i”, “aPHP is the website scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/<0-9>php/i”, “_PHP is the website scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php/i”, “aPHP is the website scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/2,5php/i”, “aPHP is the website scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
http://vn2.php.net/manual/en/regexp.introduction.phphttp://vn2.php.net/manual/en/regexp.reference.meta.phphttp://vn2.php.net/manual/en/regexp.reference.escape.php
Posted in: PHP

Design by không tính phí WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Blogger Templates
Bạn đang xem: Chủ đề: tách từng chữ trong chuỗi với php
accessASP.NETBaoMatc#c++CSShackerHTMLJSMangPCPhần cứngPHPsqlThông tin công nghệThủ thuậtTLsqlTTvbaVirus



Cách sử dụng:+ bởi vì những vì sao ở trên, mình ý kiến đề xuất bạn yêu cầu chuyển sang dùng nhóm hàm preg_… luôn.+ Sau đấy là một số hàm thuộc nhóm preg_…:
preg_match()– Perform a regular expression match (so sánh)preg_replace()– Perform a regular expression search and replace (tìm kiếm và vắt thế)preg_split()– Split string by a regular expression (tìm kiếm và cắt bỏ)preg_last_error()– Returns the error code of the last PCRE regex executionpreg_match_all()– Perform a global regular expression match
Như vậy sự việc sử dụng các hàm như vậy nào, thì các bạn xem trên:http://www.php.net, Tiếp theo, mình vẫn bàn thêm cách viết các biểu thức định dạng như vậy nào? Tức là: trường hợp viết bởi văn thì là: “4 con số đứng ngay tức thì nhau, rồi mang lại dấu – , rồi cho 2 chữ số, rồi mang lại dấu -, rồi mang đến 2 chữ số nữa” mà lại viết đến php phát âm thì viết như thế nào?
if (preg_match(“/php/”, “PHP is the website scripting language of choice.”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php/i”, “PHP is the website scripting language of choice.”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/^php/i”, “Content PHP is the web scripting language of choice.”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php$/i”, “PHP is the web scripting language of choice. & I choice PHP”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php(s)pro/i”, “PHP pro is the web scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
Xem thêm: Phụ Nữ Tuổi 40 Ngoại Tình - Phụ Nữ Ngoại Tình Ở Tuổi 40
if (preg_match(“/php(s)?pro/i”, “PHPpro is the website scripting language of choice. Và I choice PHP”)) echo “A match was found.”; else echo “A match was not found.”;?>if (preg_match(“/php(s)*pro/i”, “PHP pro is the website scripting language of choice. And I choice PHP”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/php(s)+pro/i”, “PHPpro is the website scripting language of choice. Và I choice PHP”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/<_,>php/i”, “_PHP is the web scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/
if (preg_match(“/<0-9>php/i”, “_PHP is the website scripting language of choice”)) echo “A match was found.”; else echo “A match was not found.”;?>
if (preg_match(“/
if (preg_match(“/
http://vn2.php.net/manual/en/regexp.introduction.phphttp://vn2.php.net/manual/en/regexp.reference.meta.phphttp://vn2.php.net/manual/en/regexp.reference.escape.php


Design by không tính phí WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Blogger Templates