wkilc Posted September 5, 2010 Share Posted September 5, 2010 I am attempting to flush values from a URL query with a pagation script. This line of code will replace one value: $page_name2 = preg_replace('/&?start=\d+/','',$page_name); This line of code will replace the second value: $page_name3 = preg_replace('/&?limit=\d+/','',$page_name); Can I combine them to replace both values in replace? This obviously isn't it: $page_name3 = preg_replace(('/&?limit=\d+/','',)&&('/&?start=\d+/','',)$page_name); Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/212605-simple-combine-these-two-values/ Share on other sites More sharing options...
.josh Posted September 5, 2010 Share Posted September 5, 2010 preg_replace('/&?(start|limit)=\d+/','',$page_name); Quote Link to comment https://forums.phpfreaks.com/topic/212605-simple-combine-these-two-values/#findComment-1107556 Share on other sites More sharing options...
wkilc Posted September 5, 2010 Author Share Posted September 5, 2010 Thank you! I'm learning... slowly. Quote Link to comment https://forums.phpfreaks.com/topic/212605-simple-combine-these-two-values/#findComment-1107557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.