• 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

Laravel Excel::store file empty after stored

How to send image,audio or video through the WhatsApp API - PHP

Doctrine 2 mapping referencing unique key

How to get an Array value inside an object in an array Php [duplicate]

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

Using if(isset($_POST['submit'])) to not display echo when script is open is not working

Sentry on Symfony: how to exclude `NotFoundHttpException`

How to send parameters in soap request in php in __soapcall() function

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

Problem with fetching data from database in Laravel

How to map the two arrays with a duplicate value?

Laravel get user data with profile

How to access a var with "-" in PHP [duplicate]

Required field only if another field has a value, must be empty otherwise

how to sort by a custom appended relation to model

About Contact Privacy policy Terms and conditions