The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I'll try to explain my problem better (please see first post again to see the code):
In my function I have to levels (so far) of checking strings that comes from the user using a form.

First I run the string trough level one to strip the html-tags. This works fine!

In level two I try to check that the string only contains accepted variables and is between 6 and 15 caracters long. This is where I have the problems. I know that the preg_match is correct. (See my previous thread)

I've tested the preg_match-if-statement outside the function and then I get it to work. But inside the function I don't get the desired result.

Does it have something to do with the way I call the function in this if-statement?