Jump to content

String trim on character occurrence


Omzy

Recommended Posts

I have a string variable, which for example can have the following values:

 

$string="This is a normal description"

$string="This is another description [advanced]"

 

Basically I want to echo $string but if it finds a "[" (square bracket) character in the string it will not echo that part. The square braket, if there is one, will only appear at the end of the string.

Link to comment
https://forums.phpfreaks.com/topic/188327-string-trim-on-character-occurrence/
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.