【发布时间】:2019-05-21 13:10:10
【问题描述】:
我必须得到一个在字符串中包含“#”的值。
Ex:
$string = '#1234 Lorem ipsum is placeholder text commonly used in the graphic, #rm1345 print, and publishing industries for previewing layouts and visual mockups';
Expected results:
#1234 and #rm1345
我应该如何从 $string 中得到上述结果?
我尝试了以下方法,但它对我没有帮助。
$contents = str_word_count($string, 2);
echo 'contents: <pre>';print_r($contents);echo '</pre>';
请帮帮我。
谢谢!
【问题讨论】: