fork(1) download
  1. <?php
  2.  
  3. $str='<li>Smartphone: Da</li>
  4. <li>Touchscreen: Da</li>
  5. <li>Tastatura QWERTY: Nu</li>
  6. <li>Tip tastatura: Standard</li>
  7. <li>Rezolutie senzor (Mp): 5</li>
  8. <li>SAR (W/kg ): 1.17</li>';
  9.  
  10. print preg_replace('/<li\b[^>]*>\K[^<:]+(?=:)/i', '<strong>$0</strong>', $str);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
<li><strong>Smartphone</strong>: Da</li>
      <li><strong>Touchscreen</strong>: Da</li>
      <li><strong>Tastatura QWERTY</strong>: Nu</li>
      <li><strong>Tip tastatura</strong>: Standard</li>
      <li><strong>Rezolutie senzor (Mp)</strong>: 5</li>
      <li><strong>SAR (W/kg )</strong>: 1.17</li>