array | return $key
Posted: Tue Dec 07, 2004 1:45 pm
Oke i have this huge list of differant kinds of things.
the form itself is with javascript
so the $_POST['area'] is being returned in numbers 1 - untill Oeffff
So i am trying to compare the number with the area in this case and than have it return the area belonging to that number. however it keeps on returning Administración - Secretariado.
Am i missing some ?
the form itself is with javascript
so the $_POST['area'] is being returned in numbers 1 - untill Oeffff
So i am trying to compare the number with the area in this case and than have it return the area belonging to that number. however it keeps on returning Administración - Secretariado.
Am i missing some ?
Code: Select all
function selected_area($area)
{
$areas = array (
'1' => 'Administración - Secretariado',
'5' => 'Ciencias',
'10' => 'Ciencias Educacionales',
'15' => 'Ciencias Sociales - Humanidades - Filologías',
'20' => 'Construcción - Arquitectura',
'25' => 'Derecho',
'30' => 'Dirección',
'35' => 'Económicas - Empresariales',
'40' => 'Ingenierías',
'45' => 'Marketing - Comunicación',
'50' => 'Oficios Profesionales',
'55' => 'Producción - Calidad',
'60' => 'Profesiones Liberales - Creativas',
'65' => 'Recursos Humanos',
'70' => 'Sanidad - Salud - Investigación',
'75' => 'Tecnología - Informática - Internet',
'80' => 'Transporte - Logística - Almacén',
'85' => 'Turismo - Restauración',
'90' => 'Ventas - Comercial');
ksort ($areas);
foreach ($areas as $keys => $area)
{
return $area;
}
}
echo selected_area($_POST['area']);