Jump to content

How do I get rid of this extra text?


Jeffro

Recommended Posts

Is the format always the same, with the literal '–' in it?

 

$str = "[text to keep] –' [text to remove]";
$new = trim(substr($str, 0, strpos($str, '–')));
echo $new;  // returns "[text to keep]"

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.