The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hot to get user ids from database to array
#1
Big Grin 
Hi,
i have a problem with my array_filter
Example i need all usernames or ids for the array_filter like the $filter examples

How can i get all ids into this format

thanks a lot for checking my thread

PHP Code:
$filter = array("1","2","3"); 
or

PHP Code:
$filter = [1,2,3]; 

array_filter example
PHP Code:
$filter = array("1","2","3");
$filter = [1,2,3];
                
$filtered 
array_filter($responseData['json'], function ($item) use ($filter) {
return 
in_array($item['id'], $filter);
}); 
admins please move my thread At
  Reply
#2
Hi there,

You will need to fetch all the users using the fetchAllUsers function. Loop them and enter them into an array. Example:
https://pastebin.com/KeFfDp7x

Thank you,
Brandin.
  Reply
#3
(03-21-2019, 04:58 PM)Brandin Wrote: Hi there,

You will need to fetch all the users using the fetchAllUsers function. Loop them and enter them into an array. Example:
https://pastebin.com/KeFfDp7x

Thank you,
Brandin.

Hi Brandin,

Thats what i need Smile)
Thanks a lot
  Reply
#4
Use PHP My insteed normal JS code.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)