filter a list by gender

There is a convenient helper function in WP core called wp_list_filter().

Easy as:

$male = wp_list_filter( $list, [ 'gender' => 'male' ] );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)