PHP头条
热点:

php字符串操作解决方案


php字符串操作
字符串:{user:link islocal='1'} /2013/userup/100/131a2Z34-800.doc {/user:link}
如何提取出/2013/userup/100/131a2Z34-800.doc 分享到:
------解决方案--------------------


$str = "{user:link islocal='1'} /2013/userup/100/131a2Z34-800.doc {/user:link}";
$preg = "#\{.*\}(.*)\{.*\}#iuUs";
preg_match_all($preg, $str, $matches);
print_r($matches[1]);


------解决方案--------------------
正则 #}\s*(\S+)\s*{#
或者用split()依据空格或花括号切分也能得到

www.phpzy.comtrue/phprm/1567.htmlTechArticlephp字符串操作解决方案 php字符串操作 字符串:{user:linkislocal='1'}/2013/userup/100/131a2Z34-800.doc{/user:link} 如何提取出/2013/userup/100/131a2Z34-800.doc 分享到: ------解决方案-------------------- $str="{us...

相关文章

相关频道:

PHP之友评论

今天推荐