兩個部分我有一個清單,這個結構捕捉相同的字符串與PHP
Boss: (test 23, of 2014)
Boss: (test 42, of 2015)
Boss: (test 70, of 2016)
我怎樣才能捕捉到數字字符串中和跨度然後包?所以結構將結束這樣的:
Boss: (test <span class="test_23">23</span>, of <span class="year_2014">2014<span>)
Boss: (test <span class="test_42">42</span>, of <span class="year_2014">2015<span>)
Boss: (test <span class="test_70">70</span>, of <span class="year_2016">2014<span>)
開始與'的preg_replace()' – nogad