I'm not sure why your forms are putting extra spaces in, that's rather stupid.
How about using str_replace to take the space out? or checking if it's a space first?
if (substr($string, 0, 1) == ' ') {
substr($string, 0, 1) == ''
}
then search for %$string%.
If the % is in already in the variable:
if (substr($string, 0, 2) == '% ') {
substr($string, 0, 2) == '%'
}
I'm can't remember exactly, but in substr the $string may go at the end (as the last arguement, not the first), so you should check the manual.
HTH,
Danny
http://MyBest50.com