Código PHP:
$arraylist['user'] = 'username';
$arraylist['password1'] = "4564654564";
$arraylist['password2'] = '4564654564';
$arraylist['mail1'] = 'mail#hotmail.com';
$arraylist['mail2'] = 'mail#hotmail.com';
$value = "
{user|CAMPO|VALOR|TEXTO_DE_RETORNO},
{password1|CAMPO|VALOR|TEXTO_DE_RETORNO},
{password2|CAMPO|VALOR|TEXTO_DE_RETORNO},
{mail1|CAMPO|VALOR|TEXTO_DE_RETORNO},
{mail2|CAMPO|VALOR|TEXTO_DE_RETORNO}";
# aca muestro este hash así para que lo puedan leer,
# en la realidad está todo junto, sin los saltos de linea
Código PHP:
$hash = split(",", $value );
for($i = 0; $i < count($hash); $i++)
{
$temp = split("\|", $hash[$i]);
$fields[$i] = $temp [0];
$ftypes[$i] = strtoupper($temp [1]);
$validt[$i] = $temp [2];
$errort[$i] = $temp [3];
}
Código PHP:
for($i = 0; $i < count($arraylist); $i++)
{
echo $arraylist[$fields[$i]];
}