Jump to content

Reg Expression to match this


shortysbest

Recommended Posts

My url for my website looks like:

 

#/photos&id=1

(in that format for most of the time)

there is one instance that i want it to look like this:

 

#/photos&id=1/#/photo=98

 

but I want to select

the first part, so I can have an if statement saying if #/photos&id=1 changes do this, else if /#/photo=98 changes do this

 

so all I really need help is is with the regexp to match:

 

#/photos&id=1

#/photos&id=1/#/photo=98

 

and that format, both will return:

 

#/photos&id=1

only that

Link to comment
https://forums.phpfreaks.com/topic/239443-reg-expression-to-match-this/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.