Just as an aside, you don't need quotes around the first expression in your [man]eregi/man call.
I'm not sure why this is true, but the [:space:] class won't match " " --- it seems to look for a different character ---
$string1=" ";
$string2=" ";
$reg1="[:space:]";
if (ereg($reg1, $string1)) {
echo "1 true<br>";
}
if (ereg($reg1, $string2)) {
echo "2 true<br>";
}
A lot of the guys 'round here seem to use PCRE's instead of POSIX ... maybe someone'll have knowledge of both and give us the answer... 🙂