<?php
$ref = array('123', '654', '555');
$in = '(' . implode(',', $ref) .')';
echo 'SELECT * FROM tabela_itens WHERE ref IN ' . $in;
PD9waHAKCgokcmVmID0gYXJyYXkoJzEyMycsICc2NTQnLCAnNTU1Jyk7CgokaW4gPSAnKCcgLiBpbXBsb2RlKCcsJywgJHJlZikgLicpJzsKCmVjaG8gJ1NFTEVDVCAqIEZST00gdGFiZWxhX2l0ZW5zIFdIRVJFIHJlZiBJTiAnIC4gJGluOw==