我有一些像這樣的代碼:PHP preg_replace函數返回的第一場比賽時使用(*)在中
$string = "background: #FFFFFF url('http://www.zxczxc.com/asd.jpg') 20px 100px no-repeat";
$value = preg_replace('/background: (.*)? ([0-9\.]+)([a-z\%]+)?/', '$2', $string);
我怎樣才能得到preg_replace
返回20px
而不是100px
?
你能分享你的預期產出嗎? –
我希望返回20px – SahebSoft
您想要退回或更換? – hassan