This question already has an answer here:
I have an array in PHP which may contain data such as this:
$data = array("Apples", "Oranges", "Grapes", "Pears");
I then want to pass these values into the mysqli
bind_param
function. For this example it would look like this:
$stmt->bind_param("ssss", $data[0], $data[1], $data[2], $data[3]);
My question is how can I produce the same results as above if the length of the array is unknown? For example it may be five, ten or 15 elements long.
</div>