I am using


for validations of field and I want to allow some fields that are optional but ereg does not allow me to validate space or empty field.My code for validation is


				if(ereg($reki[$var],$val)) {$class="good";}//this condition is checking the values of all the fields but I want some fields to be allowed

				else {$class="bad";$nbad++;}





I have used this pattern but it is not working

$reki["business"]="{ }";
$reki["business"]=" ";

But no success.Can anyone help me.
Thanks in advance

$reki["business"]=" *";

Would mean zero or more spaces, is that what you want ?

Sidenote: ereg has been deprecated, I suggest you switch to the preg_XXX functions instead.

Thanks a lot I have solved the problem and thanks for the information that ereg is deprecated