[請益] 字串正規化請益(新手)
請問各位一個問題
如果我有一串字串像是這樣 http://localhost/xxx/yyy
要怎麼做才能變成 <http://localhost/xxx/yyy>
這樣勒?
我之前嘗試過用
function _show_sparql_replace_str_1($urlStr) {
$replace = '<';
$result = preg_replace('/^h/', $replace, $urlStr);
return $result;
}
function _show_sparql_replace_str_2($urlStr) {
$replace = '>';
$result = preg_replace('/$\s/', $replace, $urlStr);
return $result;
}
可是這兩個function似乎沒有作用
麻煩各位了
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.129.20.134
→
07/16 21:17, , 1F
07/16 21:17, 1F
推
07/16 21:17, , 2F
07/16 21:17, 2F
→
07/16 21:18, , 3F
07/16 21:18, 3F
→
07/16 21:18, , 4F
07/16 21:18, 4F
→
07/16 21:21, , 5F
07/16 21:21, 5F
→
07/16 21:45, , 6F
07/16 21:45, 6F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
4
18
6
15