Link to home
Start Free TrialLog in
Avatar of mohan21_kumar
mohan21_kumar

asked on

Retruve the multiple value from the select multiple tag in PHP

Hi Experts,

    I have an html file which has a select tag with multiple selection and i want to get the selected multiple value from that html file to the php file

 html file is as follows

<html>
<body>
<select name = "option" multiple>
<option>one</option>
<option>two</option>
<option> three</option>
</select>
</body>
</html>

PHP file is as follows

<?php

    $selectvalue = $_POST['option'];

?>

but in this php file i'm getting only one value and i'm nit getting multiple value.

Please help me out to solve this .
 or give me some example that would help me out

Thanx

Avatar of gourav_jain
gourav_jain

Hi,

use @selectvalue = $_POST['option'] instead, this will give you the array of all the values of your form variable "option".

Gourav Jain
ASKER CERTIFIED SOLUTION
Avatar of peakpeak
peakpeak
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial