• 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

Redirect to previous page with php

PHP file_get_contents function

Yii2: How do I debug console commands?

Can I write PHP code across multiple lines per statement?

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

Comma separated list from array with "and" before last element

How can I create a Download Page with post php method?

Yii Ajax Submit button

Entity provider not working in security.yml php symfony3.4 ({"code":401,"message":"bad credentials"}.)

PHP error: "The zip extension and unzip command are both missing, skipping."

Using array_intersect on a multi-dimensional array

Move a child array to parent array and change parent/child name

Submitting a form with ajax in Wordpress

PHP usort() order in case of equality

About Contact Privacy policy Terms and conditions