Jump to content

Remove strings


sandy1028

Recommended Posts

I would actually change the regex above to match <br />, < BR>, < br / >, etc by doing the following. It's never good to assume you're getting well formed HTML:

 

$input = "By rd, RaeAnn Martin, Emily Sheene and Ebony Alcorn.<br /><br /> <p>Danville High School students:";

$output = preg_replace('#<\s*br\s*\/?\s*>.*#i', '', $input);

Link to comment
https://forums.phpfreaks.com/topic/219432-remove-strings/#findComment-1138031
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.