dzwestwindsor Posted August 31, 2010 Share Posted August 31, 2010 Hi hello, Right now I have this generated URL: mywebsite.com/thisismypage?compare0=50&compare1=112&compare2=512 Is there anyway to "extract" the 50, 112, and 512 dynamically? Those numbers are the Item ID's, I need them for further operations. So is there a way to extract the IDs, maybe into an array? The ID's are dynamically rendered, as well as the "compare#". Not sure if I am being clear... hopefully this makes sense. All help is appreciated. Thank you. Link to comment https://forums.phpfreaks.com/topic/212209-check-url-parameters/ Share on other sites More sharing options...
Pikachu2000 Posted August 31, 2010 Share Posted August 31, 2010 They're already in an array. They're in the $_GET superglobal array. Link to comment https://forums.phpfreaks.com/topic/212209-check-url-parameters/#findComment-1105785 Share on other sites More sharing options...
Alex Posted August 31, 2010 Share Posted August 31, 2010 $compare = array(); $i = 0; while(isset($_GET['compare' . $i])) { $compare[] = $_GET['compare' . $i]; } print_r($compare); Link to comment https://forums.phpfreaks.com/topic/212209-check-url-parameters/#findComment-1105786 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.