I have a line like this:
<span style="font-weight: bold;">Foo</span>
I want to use PHP to make it
<strong>Foo</strong>
... without affecting other spans.
span
How can i do this?
$text='<span style="font-weight: bold;">Foo</span>'; $text=preg_replace( '/<span style="font-weight: bold;">(.*?)<\/span>/', '<strong>$1</strong>',$text);
Note : only works for your example.
Source: https://habr.com/ru/post/1743152/More articles:Starting with ORMS - Nhibernate - ormLocal / Dev / Live Deployment - Best Workflow - phpiPhone - detect end of animation - objective-cclass foo; in the header file - c ++Ruby on Rails - автономное программирование - rubyIs NULL in table fields better than empty fields? - mysqlFinding a value of a smaller value and swap in php - comparisonWPF docking recommendation - wpfCan I use Catalyst to display images or graphs? - perlASP.NET user role management - c #All Articles