feri_soft Posted October 22, 2006 Share Posted October 22, 2006 I have the following problem i have 5 checkboxes with the name asd[]when someone is adding an article he is cheking for example 3 checkboxes with values 2,4,5Then i have a search page.A user selects the chekboxes but in that order:5,2,4Will php create the same array with the values 2,4,5 ordering them in alph. order or it will create an array like 5,2,4.And if the second how can i make a search,because the values are the same but as they are stored in the row like 2,4,5 and i search for 5,2,4 i wont get anything.Please help :) Quote Link to comment Share on other sites More sharing options...
Orio Posted October 22, 2006 Share Posted October 22, 2006 I dont know, but you can just use the function [url=http://www.php.net/manual/en/function.sort.php]sort()[/url] on both arrays before comparing :)Orio. Quote Link to comment Share on other sites More sharing options...
alpine Posted October 22, 2006 Share Posted October 22, 2006 example:[code]<?php$asd = array(9,15,5,3,7,1);sort($asd);reset($asd);$new_asd = implode($asd,",");echo $new_asd; // 1,3,5,7,9,15?>[/code] Quote Link to comment Share on other sites More sharing options...
feri_soft Posted October 22, 2006 Author Share Posted October 22, 2006 Thanks! 10x 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.