I want to work with a loop inside the search arguments, like below
$community = array("eleven_polls", "activities_coordinator", "attractively_priced_onsite_laundry_care_centers");
$community_count = count($community);
$args = array(
'numberposts' => -1,
'post_type' => 'apartment',
'meta_query' => array(
'relation' => 'AND',
array(
'relation' => 'AND',
for ($i=0; $i < $community_count ; $i++) {
array(
'key' => 'community',
'value' => $_GET['community'][$i],
'compare' => 'LIKE'
),
}
)
)
);
but it is showing syntax error on the line for loop, how to I run for loop inside an array