Domanda

Is there anyway to do preg_replace with that:

<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>

I just want to remove or leave with spaces the price. I don't know how to define the pattern and the replacement expressions.

Hope anyone helps me!

TY.

EDIT: I just want to remove the 43.19 ., being just Coût de la prestation :

È stato utile?

Soluzione 2

Finally what worked was:

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

Thanks to all.

Altri suggerimenti

Did you try the u modifier?

Something like:

preg_replace('/Coût de la prestation : (\d+\.\d{2})/u', 'whatever', $str);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top