• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

how to remove white space in select 2

phpjqueryajax


PHP Snippet 1:

$imei = $row["IMEI_MX"];
$imeiserial = explode(',', $imei);

echo '<select id="tags" name="imei" disabled class="form-control" onchange="getCount()" multiple>';

foreach($imeiserial as $is){
    $wew = trim($is);

    if (!empty($wew)) {
        echo "<option value='$wew'>$wew</option>";
    }
}
echo '</select>';

PHP Snippet 2:

<option value='867637026628082, 867637026628090'>867637026628082</option>

PHP Snippet 3:

<option value='867637026628082'>867637026628082</option>

Related Snippets

How do I remove this delivery notification from here?

Laravel Collections. Is there some kind of assertStructure method?

Trying to iterate over a mongodb cursor twice - failing

Array to string conversion

Laravel Blade checkbox not checked

PHP Sorting - getting 10, 11, 12 ... 1, 20, 2 rather than 1, 10, 11, 12 ... 2, 20

IlluminateDatabaseQueryException could not find driver [duplicate]

Laravel query builder binding parameters more than once

How to run a shell as root from php (apache)

Laravel relationship belongsToMany with composite primary keys

Laravel SQL query midnight time not showing

PHP SoapClient: set a namespace without prefix

how can I set a session variable in Drupal 8 and get it in a php script?

Toggle between a textbox and a select using PHP

Select option from dropdown menu with PHP and mySql

About Contact Privacy policy Terms and conditions