Jump to content

String Replace


spires

Recommended Posts

Hi

 

I have a string that is pulled from a database.

I want to remove the title, but not sure how I do it.

 

I was trying something like this:

$string = '<strong>Dynamic Title, so will be different on every loop</strong> Rest of text etc';
$newString = preg_replace('<strong>[^A-Za-z0-9_-]+</strong><br />', '', $string);

 

Any ideas?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/267968-string-replace/
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.