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. 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); 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. 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
Archived
This topic is now archived and is closed to further replies.