• 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

possible options to create pdf file using html elements to generate invoice in php and codeigniter

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

How to submit a form when page loads using JavaScript?

Is it possible to re-use an array taken from PHP via JSON in a $.ajax function?

Refresh specific HTML content that retrieves data from MySQL

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

Store / Website Column in Magento 2 Admin Grid - Custom Module

AJAX call fails with SyntaxError: Unexpected end of JSON input

PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll

CSS file not imported in laravel blade view

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

How to use PHPCBF to fix one issue at a time?

Convert date and time to Jalali in Laravel

Saving Data from form to database using AngularJS and php

Getting output of MS stored procedure on php call

About Contact Privacy policy Terms and conditions