dadamssg Posted March 27, 2009 Share Posted March 27, 2009 how would i count how many strings are in a certain array? i want to set up a confirm.php script. I have a register script that will email them a welcome message after they register, but i want it to contain a confirmation link with some variables in the url. In my confirm script i want to grab those variables and check for each one if they match what i have in the db and then confirm them. so it would look like this... 1. query the database based on $_POST['id'] and grab their info 2. for each variable i put in the url, match to see if it matches what i have in the db. 3. if the first one matches, set an array with a string in it 4. continue in the same array for each one 5.check if the array has 3 values stored in it 6.if it does confirm, otherwise send them to the register page Link to comment https://forums.phpfreaks.com/topic/151327-array-counter/ Share on other sites More sharing options...
lonewolf217 Posted March 27, 2009 Share Posted March 27, 2009 why not concatonate all the variables together and do a strcmp or something Link to comment https://forums.phpfreaks.com/topic/151327-array-counter/#findComment-794849 Share on other sites More sharing options...
Daniel0 Posted March 27, 2009 Share Posted March 27, 2009 Is it something like this you're looking for? $info = array( 'foo' => 'bar', 'msg' => 'hello', ); $url = 'http://example.com/script.php?' . http_build_query($info); // The URL will be http://example.com/script.php?foo=bar&msg=hello in this case Link to comment https://forums.phpfreaks.com/topic/151327-array-counter/#findComment-794932 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.