I'm sorry I haven't responded sooner but my schedule is very busy and I haven't been able to get a really good idea of what you need.
Here is my problem. I don't know what else is going on! For example, the way your code is written, all numbers and lowercase letters are replaced with nothing. Basically, as I'm reading it, you search for $allowed and replace it with nothing (In other words, you are deleting it), then replacing spaces with dashes and finally making all characters lowercase!
Perhaps there is a typo in the code you posted but that is how I see it. What I don't understand is what you are trying to do. Are you trying to create an SEF URL or are you trying to process (read) an SEF URL?
If you are trying to read an SEF that you have generated, then I suggest using mod_rewrite for Apache. Basically, that takes a URL request that looks like one thing and turns it into something that the script will understand.
For example, if your "working" link looked like this:
http://www.madeinshropshire.co.uk/demo/index.php?title=about+us
mod_rewrite would change:
http://www.madeinshropshire.co.uk/demo/about_us.html
so that the script actually read it the correct way.
Now, if you are only going to make very small changes to the URL's, then you can do that in PHP.
For example, the reason that you have "title=about%20us" is to pass information to the script. In this case you are telling the script that the variable $_GET['title'] = 'about us'!
What ever else you are trying to do, you can use that variable for your use in this situation.
Assuming that "about us" corresponds to and actual file or database entry, then "about-us" would not match that corresponding entity. You need to tell the script that the one is the same as the other or tell the script to change one to the other!
If you are looking for "about us" in the database and you want to use the query URL title=about-us, then you need to change the query URL to match the database entry like so:
$title = str_replace('-', ' ', $_GET['title']);
Then you can search the database for $title instead of $_GET['title']!
If you are wanting true SEF URL's then you'll need to replace the query URL with a standard URL and use mod_rewrite to rewrite the standard URL into a query URL that the script will recognize.
If this is not what you are needing, please try to be more specific as to what you are trying to do and the methods that you have tried. It isn't important whether or not the methods you tried worked or not but knowing what you already tried will give me and others that read this a better idea of your end goal is.
vujsa