title: Methods to remove specific characters from string?
body: <p>I need to remove the brackets "[" and "]" from <code>$widget_text</code> in the variable value below and store the result in <code>$widget_id</code>.</p>
  
  <pre><code>$widget_text = '[widget_and-some-text]';
  $widget_id = ?;
  </code></pre>
  
  <p>Use <code>preg_replace</code>, <code>str_replace</code> or something else?</p>