simpli Posted March 22, 2009 Share Posted March 22, 2009 Hi, I have a form with let's say 10 input fields Player1='Wayne Gretzky' player2='Mario Lemieux' player3='Wayne Gretzky' and so on until 10. I do NOT want users to choose the same player twice. How could I verify if this rule is respected in php? Is there a ready-made function with arrays which I can count the number of occurence of each single players? Or do i have to go recursively and check that each player hasn't been inserted before? I wouldn't want to do it recursively as I know it would not be efficient. Any input is welcome. Thank you, J-R Link to comment https://forums.phpfreaks.com/topic/150538-check-for-multiple-entries/ Share on other sites More sharing options...
Floydian Posted March 22, 2009 Share Posted March 22, 2009 Try this out: http://us3.php.net/manual/en/function.array-count-values.php Hope that helps... Link to comment https://forums.phpfreaks.com/topic/150538-check-for-multiple-entries/#findComment-790705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.