I have following string:

```
$sql = sql_prepare("UPDATE `test` SET `item1` = ?, `item2` = ?, `item3` = ?", array(50, 55, 60));

```

I need to create "sql\_prepare" function that will match all occurencies of '?' char and replace with elements from array, so final sql will be:

```
UPDATE `test` SET `item1` = 50, `item2` = 55, `item3` = 60

```

How can I do that?