看板 PHP 關於我們 聯絡資訊
※ 引述《hate5566 (黑特56)》之銘言: : 請問一下 在表單內的文字內容 : 若出現 http://xxx.xxx.xxx.xx : 要如何自動將它轉換成網址呢? '/^(((http|https|ftp):\/\/)?([[a-zA-Z0-9]\-\.])+(\.)([[a-zA-Z0-9]]){2,4} ([[a-zA-Z0-9]\/+=%&_\.~?\-]*))*$/' 參考網站: 37 Tested PHP, Perl, and JavaScript Regular Expressions http://tinyurl.com/lsd59j 裡面還有很多可以用的 http://tw.php.net/manual/en/function.preg-replace.php -- AppleBoy Blog: http://blog.wu-boy.com -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 115.43.14.208
l8 :#13Ga1MSY 10/03 18:28
appleboy46:樓上提供的文章,比較不嚴謹 .... 10/04 00:55
yanli2:我是比較好奇 有些網址參數遇到中文怎麼辦? 10/04 01:29
arrack:正規的網址,是沒有中文的,需要經過編碼 10/04 08:08
arrack:不過後面那段沒出來,不會用的人可能還是不會 10/04 08:22
chocho1981:同意樓上.. 10/04 10:21
appleboy46:http://tw.php.net/urlencode 10/04 11:52
arrack:XD接在一起說,好像被誤會了,是指取代的部分~ 10/04 11:58