I'm trying to post the implode data of multiple select html to database but it is dynamic. Result will be like this:
data1|data2|data3 = from multiple select(already get)
how can I achieve this kind of result? It is separated with commas
data1|data2|data3, data1|data2|data3, data1|data2|data3
The separated data inside the commas come from another multiple select.
Here's my code HTML
<div class="required field">
  <label>Subjects:</label>
  <select class="ui fluid search dropdown" name="pass_subj[]" multiple="">
    <option value="">Subject</option>
    <option value="data1">subject1</option>
    <option value="data2">subject2</option>
    <option value="data3">subject3</option>
    <option value="data4">subject4</option>
    <option value="data5">subject5</option>
  </select>
</div>
<div class="two wide field" style="padding: 23px 0px 0px;">
  <button class="passmore ui icon yellow button" type="button">
    <i class="plus icon"></i>
  </button>
</div>
php
$pass_subj = $_POST['pass_subj'];
$pass_subjs = implode("|", $pass_subj);