Like i hoped just meant i wanted it to remov the space and it didn't.
i don't think there is any more relevant code, at least i wouldn't know what portions to include. The waya the script works is that a user fills out a form and upon pressing submit the page processing the form calls a function that i wrote to check to returned values.
one of those values $machine begins with a space because is in a select menu and i am using spaces to break up the options.
this is my test script:
echo "machine = '$machine'."; //this returns machine = ' PP2'.
$erMachine = ereg_replace(" ", "", $machine);
echo "erMachine = '$erMachine'."; //this returns machine = ' PP2'.
It is cut and pasted so the syntax is exactly like i have it. If it is working for you do you know why it might not be working for me?