Jump to content

Optional last parameter


Andy-H

Recommended Posts

 

I have the following regular expression, was just wondering if anyone knew of a way I could make the last forward-slash and parameter (radius) optional, thanks for any help

~^/shops/(?P<lat>([-+]?[0-9]*\.?[0-9]+))/(?P<lng>([-+]?[0-9]*\.?[0-9]+))/(?P<radius>([0-9]?))$~u

Link to comment
https://forums.phpfreaks.com/topic/265240-optional-last-parameter/
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.