The14thGOD Posted March 24, 2007 Share Posted March 24, 2007 Hey, I was wondering, how would you go about getting an array form the URL? can you just post it like this "domain.com/index.php?array=1,2,3,4 and then use: <?php $array = $_GET['array']; and then the array would read as: $array[0] == 1 $array[1] == 2 etc... thanks in advance Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted March 24, 2007 Share Posted March 24, 2007 im not sure..im sure this will work.... url: ?var[]=hello&var[]=hi&var[]=howru prin_r($_GET[var]); Quote Link to comment Share on other sites More sharing options...
Orio Posted March 24, 2007 Share Posted March 24, 2007 <?php //The requested page is "domain.com/index.php?array=1,2,3,4" $array = explode(",", $_GET['array']); print_r($array); ?> Orio. Quote Link to comment Share on other sites More sharing options...
DanDaBeginner Posted March 24, 2007 Share Posted March 24, 2007 good idea orio, why didn't I think of that... I forgot the power of explode... 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.