title: how to remove white space in select 2
body: <p>I had dynamically added the value of the option in select2 as it came from the database but when the field has no value the space can be selected.</p>
  <p>How should I remove the spaces? I tried this codes but nothing happens</p>
  <pre><code>$imei = $row[&quot;IMEI_MX&quot;];
  $imeiserial = explode(',', $imei);
  
  &lt;select id=&quot;tags&quot;
      name=&quot;imei&quot;
      class=&quot;form-control&quot;
      onchange=&quot;getCount()&quot;
      multiple
      disabled
  &gt;
  foreach ($imeiserial as $imeiserial) {
      $wew = ltrim($imeiserial, &quot; \t.&quot;);
      echo '&lt;option value=' . $imei . '&gt;' . $wew . '&lt;/option&gt;';
  </code></pre>
  <p><a href="https://i.stack.imgur.com/M5wlO.png" rel="nofollow noreferrer">Screenshot</a></p>