php - Preg_replace in following string -


i want replace content below string,

i want replace line the part has been repaired to upto end p tag.

$text = "<p>701082 range control board dacor manufacturer approved part. part has been repaired dacor's specifications resulting in highest performance superior quality</p>";  preg_replace('/the part has been repaired to.*?<\/p>/u', '</p>', $text);  print_r($text); 

i tried above preg_replace function not working expected.

the preg_replace function returns value of string after pattern has been applied it. assign result variable , print_r variable.

$text = "<p>701082 range control board dacor manufacturer approved part. part has been repaired dacor's specifications resulting in highest performance superior quality</p>";  $result  = preg_replace('/the part has been repaired to.*?<\/p>/u', '</p>', $text);  print_r($result); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -