- implode: documentation ( source)
- array_fill: documentation ( source)
<?php
$array = array('new','used');
$placeholder = implode( ',', array_fill( 0, count( $array ), '?' ) );
$sql = 'select p.name,p.image from product p where p.condition in (' . $placeholder . ')';
echo $sql;