I have something like the following :


//Suppose that the array $hidden contains a list of strings

$pos = 0;
while (eregi("<HIDDEN>[0-9]+</HIDDEN>",$text,$val)) {

$text = str_replace($val[0], $hidden[$pos], $text);

Here, I'd like to do something like:
$text = str_replace($val[0], $hidden[$val[0]], $text);

so that I get the correct string from the $hidden array... The problem
is that $val[0] actually is a string while the $hidden array is
indexed by numbers (0 points to first string, 1 to second, and so

echo $val[0]; will display "0" or "1"
echo intval($val[0]) will always display 0

I tried using (int) $val[0] and settype($val[0], "integer") but that
gives the same results...

Any ideas... ?

Thank you for your time and help !