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. Quote Link to comment 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. Quote Link to comment 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); Quote Link to comment 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.