I think I should use JOIN but I did this instead
First, about your current code:


You're doing a SELECT *. This is generally poor practice; instead, explicitly identify the columns you need: SELECT id, first_name.
Your $rep_array is a lookup table, so name it as such. Maybe $rep_id_to_name or something?
Your way of adding to the array is bad; it won't work if the rep ids are not contiguous. Instead, just directly set the id:

$rep_array = array();
while ($rep = mysqli_fetch_assoc($rep_query_result)) {
    $rep_array[$rep['id']] = $rep['first_name'];
}



Now, about using a JOIN...


I don't know the query for domains, but I'll assume it's something like this:

SELECT d.rep, ...
FROM `domains` d
WHERE ...


Then in order to use a join, you could do (note the absence of d.rep in the SELECT list:

SELECT r.first_name AS rep, ...
FROM `domains` d
JOIN `reps` r ON d.rep = r.id
WHERE ...


This will get the behaviour you want, but it wouldn't hurt to give a more meaningful name to rep. Keyboard strokes are (almost) free! Consider representative_name or something.