I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage. The original block of text can be a lengthy artic
Use this:
the following code will remove ','. If you have anyother character or sub-string, you may use that instead of ','
substr($string, 0, strrpos(substr($string, 0, $comparingLength), ','))
// if you have another string account for
substr($string, 0, strrpos(substr($string, 0, $comparingLength-strlen($currentString)), ','))