I have a code of a select field where I need to be dynamically in an array the option selected by the user. Every time the user starts the page, the selected option appears. Here is the code:
<?php
header("content-type: text/html; charset=utf-8");
$cursos=array('JAVA','PHP','Python');
?>
</html>
<select value="teste">
<option value="">Selecione</option>
<?php
foreach($cursos as $curso) {
?>
<option value="<?php echo $curso;?>"<?php ?>><?php echo $curso;?></option>
<?php
}
?>
</select>