• 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: Why is my variable not being set while it's in the construct function of the controller?

Explode not working properly with dash

How to pass security cloudflare server with php curl

Batch request Google Calendar php API

Unable to create lockable file - Laravel 8 & PHP 8

Handling expired token in Laravel

generating a random code in php?

Using spatie/media-library, how to rename a collection of uploaded files?

get folder directory from input type file - PHP

Nginx RTMP not recording

PHP random string generator

Composer Warning: openssl extension is missing. How to enable in WAMP

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

Woocommerce Edit Message "An account is already registered with your email address. Please log in."

Add a custom text for a particular product on specific email notification in Woocommerce

About Contact Privacy policy Terms and conditions