I want to consult whoever corresponds, something that should have a solution. It turns out that I have a form with several text fields, other so many of simple selection and a field of multiple selection. Using select2.
The data of the completed forms is collected by PHPMailer. each field has a name="....." value, and everything is fine, except that in the multiple-selection field only a single value of the selected ones is taken, the last one,
The PHP Mailer reads like this
$message .= "<tr><td><strong>|Barcos|</strong> </td><td>" . s trip_tags($params['user-barcos']) . "</td></tr>";
The html form
asi
<select multiple="multiple" class="js-example-placeholder-multiple form-control" name="user-prestadores" id="user-prestadores" data-toggle="tooltip" title="Puedes comenzar a escribir la que buscas o seleccionar del listado. Es opcional">
<optgroup label="Delta">
<option value="Bote">Bote</option>
<option value="lancha">lancha</option>
<option value="Velero">Velero</option>
<option value="Crucero">Crucero</option>
</select>