时间:2021-07-01 10:21:17 帮助过:12人阅读
- <br>
- <!--?php<br /-->
- $timestamp = '2012年02月03 15:06:46';<br>
- preg_match_all("/(.*?)年(.*?)/is", $timestamp, $rarr, PREG_SET_ORDER);<br>
- print_r($rarr);<br>
- <br>
- preg_match_all("/(.*?)年(.*?)月(.*?) (.*?):(.*?):(.*?)/is", $timestamp, $rarr, PREG_SET_ORDER);<br>
- print_r($rarr);<br>
- ?><br>
- $timestamp = '2012年02月03 15:06:46';<br>
- preg_match_all('/\d+/', $timestamp, $rarr);<br>
- print_r($rarr);<br>
- preg_match_all('/[^年^月^\s^\:]+/', $timestamp, $rarr);