Skip to content
Advertisement

How to extract a specific parameter in a URL?

I’m trying to only strip out a specific parameter from a URL, but I can only do it at its base form. If the script I use adds additional parameter, then that messes up my output. Here is what I currently have

JavaScript

This works perfectly if the $baseUrl = https://www.example.com/page/?id[]=

However, the $baseURL can equal anything. A few examples are

JavaScript

How can I extract the value in just “id[]=” ?

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement