2013-07-01 44 views
0

反正有做的preg_replace與:的preg_replace HTML和變音符號

<p style="background:white"> 
<span style="font-size:10.0pt;font-family:&quot;Trebuchet MS&quot;,&quot;sans-serif&quot;"> 
Coût de la prestation : 43.19 . <u></u><u></u></span></p> 

我只是想刪除或用空格離開的價格。我不知道如何定義模式和替換表達式。

希望有人幫助我!

TY。

編輯:我只是想刪除43.19,是剛剛COUT德拉給付:

+1

您能否澄清您正在嘗試做的事情(「我只想刪除或留下空位價格」)? –

回答

0

最後什麼工作是:

preg_replace('#(Coût\s+de\s+la\s+prestation)\s*:\s*\d+(\.\d+)?#u', '$1:', $body); 

感謝所有。

1

你嘗試u modifier

喜歡的東西:

preg_replace('/Coût de la prestation : (\d+\.\d{2})/u', 'whatever', $str); 
+0

它不起作用... – ganlub