• 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

Phalcon: setStatusCode returns empty response

Need to display only array value in JSON output

Add and update products to session cart in Laravel

PhP how to calculate moments with variables rows

How update php.ini on a Mac OS X Mojave?

500 (Internal Server Error) with Laravel & Docker [duplicate]

PHP Discord OAUTH2 code sample not working

unable to load your default controller on Codeigniter

Undefined Array Key error when uploading image on php

xdebug 3 not working in ubuntu 20.04 with docker

carbon generated datetime not stored correctly into the database

RabbitMQ PRECONDITION_FAILED - unknown delivery tag

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

Laravel - Browser displays message again when I press back button

PHP AWS Cognito 'Error executing "SignUp" : ResourceNotFoundException : User pool client XXXX does not exist

About Contact Privacy policy Terms and conditions