I have an url string like this in php:
$string = 'test.xyz/builder-list/?price=301-500%2C501-1000&builder_country=6442%2C6780%2C6441';
i want to remove specific string from price query value in the URL string that started with `%2c. for example:
test.xyz/builder-list/?price=301-500%2C501-1000&builder_country=6442%2C6780%2C6441
into
test.xyz/builder-list/?price=301-500&builder_country=6442%2C6780%2C6441
test.xyz/builder-list/?price=-200%2C400-500&builder_region=1223%2C3445
into
test.xyz/builder-list/?price=-200&builder_region=12%2C33
test.xyz/builder-list/?builder_state=45%2C76&price=-200%2C400-500
into
test.xyz/builder-list/?builder_state=45%2C76&price=-200
i tried to use this preg_replace function , but it deletes all the %2C string
preg_replace('/' . preg_quote('%2C') . '.*?/', '', $string);
urldecode, no need to regular expressionspricequery parameter in the string URL , that's why i need to replace the %2C and the rest of the value frompricequery parameter in my URL string