Kashif Ali

Kashif Ali

  • 1.9k
  • 78
  • 3.4k

how to pass multiple values to an array PHP

Jan 15 2019 6:11 AM
<select id="framework" name="framework" placeholder="Users" multiple class="form-control" style="width:width: 400px; overflow-y: all; max-height: 200px;">
<option value="one@gmail.com"> one</option>
<option value="two@gmail.com"> two</option>
</select>
<?php
$students = $_POST["framework"];
 
/*keep in mind $students takes multiple values like one,two */
 
Now i want to show these value in
 
$emails = array(',' , $students);
 
Is it correct?
 
For example
 
$students have these values: one, two, three, four
 
It should be go in array like
 
$emails = array(',' , 'one', 'two', 'three', 'four') ;
 
Please guide me, how i can do this please!

Brought to you by:

Answers (4)