estoy intentando extraer de una array la informacion y asociar el nombre a la clave del array.
con un una array me funciona correctamente pero al pasarlo por un bucle foreach me sigue mostrando un resultado cuando hay 2.
el script es el siguiente:
Código PHP:
$myArray = explode(',', $uploadServer);
$status = array(0 => "Unprocessed",
1 => "Processing",
2 => "Download aborted because the file became too big.",
3 => "Download aborted because the file downloaded too long.",
4 => "Download finished. Uploading to RapidShare.",
5 => "Upload to RapidShare finished. Job finished.",
7 => "Upload failed 3 times for unknown reasons. Job aborted.",
8 => "Upload failed because the file is black listed.",
9 => "Download failed for unknown reasons.",
11 => "Enqueued for later processing because this account already downloads 5 files at the same time.");
foreach ($myArray as $valor) {
if(array_key_exists($myArray[3],$status)) {
return array($status[$myArray[3]]);
} else {
return FALSE;
}
}
gracias de antemano