php - Preg replace can not replace this tag? -
i using code remove between tag,however can't make happen. missing here?
$str ='<tr class="main_row pc"> <td class="details"> <a href="./view/4135660/"><span class="p_t">fiat cinquecento </span></a> <a class="info" href="./view/4135660/">(info)</a><br> <div class="attribs">16345, <span class="p_l">blue</span>, phone 6914576304 </div> </td> </tr>'; $str = preg_replace('#(<tr class="main_row pc">).*?(</tr>)#', '$1$2', $str);
you need use s
modifier .
match newlines:
$str = preg_replace('#(<tr class="main_row pc">).*?(</tr>)#s', '$1$2', $str);
Comments
Post a Comment