|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
regex for path determination
I have a config file I use for public stuff as well as admin stuff
![]() I need help constructing a regex that can find the word "admin" when I pass $_SERVER['SCRIPT_NAME'] to it. So when I echo $_SERVER['SCRIPT_NAME'] now I get /pps/admin/mypages.php I have never looked into regex's before, and there may be a better way of doing what I need to do. If you know of one, lemme know,.. TIA
__________________
-- Jason |
|
#2
|
|||
|
|||
|
Well, you don't need a regexp for it. You can do ->
PHP Code:
__________________
~ Joe Penn We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set? Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you. |
|
#3
|
|||
|
|||
|
This works:
PHP Code:
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#4
|
|||
|
|||
|
Quote:
The above will work, but if you have a script called "pre_admin_page.php" or something similar, even though it isn't an admin page, it will get picked up as one. |
|
#5
|
|||
|
|||
|
the way jpenn has it is exactly what I need. thanks for both quick replies though.
![]() |
|
#6
|
|||
|
|||
|
Anytime
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > regex for path determination |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|