Your question, your audience. Choose who sees your identity—and your question—with question security.
if(preg_match('|^.*?/clients/[a-zA-Z0-9]+\.php\b.*$|', $_SERVER['REQUEST_URI'])) {
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
And in any case, the rules for URLs are not really quite as simple as you may think. If you control the creation of the URLs, that is a good step in the right direction, but with REQUEST_URI your rules must also account for (or deliberately ignore) the request variables.
This article has some ideas about how to test the REGEX, but I still think that your business-rules explanation will get you a better approach.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_7830-A-Quick-Tour-of-Test-Driven-Development.html
Open in new window