how to remove a specific character from a string php code example Example: trim specific character from strin using php $widget_id = trim($widget_text,'[]')