Example #7 only shows the binding of a small fixed number of values in an IN clause. There is also a way to bind multiple conditions with a variable number of values.
<?php
$ids = array(
103,
104
);
$conn = oci_pconnect($user, $pass, $tns);
$sql = 'SELECT * FROM employees WHERE employee_id IN (SELECT column_value FROM table(:ids))';
$stmt = oci_parse($conn, $sql);
$idCollection = oci_new_collection($conn, 'ODCINUMBERLIST', 'SYS');
foreach ($ids as $id) {
$idCollection->append($id);
}
oci_bind_by_name($stmt, ':ids', $idCollection, -1, SQLT_NTY);
oci_execute($stmt, OCI_DEFAULT);
oci_fetch_all($stmt, $return);
oci_free_statement($stmt);
oci_close($conn);
?>