I ask you, native English speakers:
What is the correct name for a variable which contains ids of multiple users (from grammar point of view):
A) users_ids vs B) user_ids
I'm pretty sure C) users_id is wrong.
The variable is an array of ids:
array(12, 43, 12, 53)
and why?
$user_ids because it refers to a list of ids (plural), each belonging to a single user (singular). When looping through the ids I often use something like the following:
$user_ids = array(12, 43, 12, 53);
foreach($user_ids as $user_id) {
// at this point $user_id refers to one id for one user
}
Besides, $user_ids is the most commonly used form (that I've seen).
$user_ids
is the most common. My reasons are:
ids
so users_id is incorrectusers_ids
sounds awkwardIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With