firstminister Posted August 20, 2012 Author Share Posted August 20, 2012 LOL sometimes i put for example: 1 6 1 6 to filter the number 6 only, and appears again: 1 6 1 6 as filtered.. And is possble that, i could set in text input, how much numbers i'm setting on the first textarea? for example: 344554 456456 546456 5466 (In input under textarea) 4 numbers and, in the results, after filter says: You hace deleted 56 numbers from list. Quote Link to comment https://forums.phpfreaks.com/topic/267323-filter-data-from-one-input/page/2/#findComment-1370905 Share on other sites More sharing options...
Drummin Posted August 20, 2012 Share Posted August 20, 2012 You can always use count(). <?php if (isset($_POST['listnumbers'])){ $Newlist = explode(PHP_EOL, trim($_POST['listnumbers'])); $before_count = count($Newlist); $Searchlist = explode(PHP_EOL, trim($_POST['searchnumbers'])); $Newlist = array_diff($Newlist,$Searchlist); $after_count = count($Newlist); $phone_number_list = implode("<br />",$Newlist); } echo "Before: $before_count After: $after_count"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/267323-filter-data-from-one-input/page/2/#findComment-1370907 Share on other sites More sharing options...
firstminister Posted August 20, 2012 Author Share Posted August 20, 2012 Excelent, i have set count as you said! perfect..i'm thankful for your help.. Can i put one little normal text input under the textarea where i put the numbers list, where appears one number like counter per line to count how much number im setting? for example, for each enter, that add +1 in the input.. and thanks for this, you are splendid. Quote Link to comment https://forums.phpfreaks.com/topic/267323-filter-data-from-one-input/page/2/#findComment-1370921 Share on other sites More sharing options...
firstminister Posted August 20, 2012 Author Share Posted August 20, 2012 oh and you know, when i set on the listnumbers 2 same numbers, and i set on searchnumbers just one number, obviously the same of listnumbers to filter, it just delete one of two numbers.. i should repeat twice the number on searchnumber to delete it.. how can i do for, just set one time the number and that deletes 2 repeated numbers on list? Quote Link to comment https://forums.phpfreaks.com/topic/267323-filter-data-from-one-input/page/2/#findComment-1370923 Share on other sites More sharing options...
Drummin Posted August 20, 2012 Share Posted August 20, 2012 If you are talking about AS you put each number in, it would update the count of numbers, no, not with php. You'd need some Javascript for that. As for duplicates in original main list not being removed, they are everytime I've tested it. I put in 1 2 1 4 ...and then filter out 1, I'm left with 2 4 Can you give me any example of numbers where it hasn't worked? Quote Link to comment https://forums.phpfreaks.com/topic/267323-filter-data-from-one-input/page/2/#findComment-1370926 Share on other sites More sharing options...
firstminister Posted August 20, 2012 Author Share Posted August 20, 2012 My idea was, place below textarea, a text field updated in real time as counter, every time you add a line in the listnumbers textarea Quote Link to comment https://forums.phpfreaks.com/topic/267323-filter-data-from-one-input/page/2/#findComment-1370949 Share on other sites More sharing options...
firstminister Posted August 20, 2012 Author Share Posted August 20, 2012 Done with JS! Thanks for your help pal! Quote Link to comment https://forums.phpfreaks.com/topic/267323-filter-data-from-one-input/page/2/#findComment-1370958 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.