PHP : How to get the select values from a Drop Down list



This is the scenario

<select name="cars">
   <option value="volvo">Volvo</option>
   <option value="audi">Audi</option>
   <option value="toyota">Toyota</option>
   <option value="form">Ford</option>
</select>

This php code – get all everything between <select>

preg_match('/<select name="foo">(.*)<\/select>/msU',$html,$matches);
print_r($matches);

You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.

 

© 2006 - 2009 BNCScripts.com . All right reserved.