Question: I have `one View Controller` that handles `three views`, to do this i use `horizontal scroll view` of size (320 \* 3 ). But if i want to use `Page Controller` now, how can i do it?. I have read that page controller will require `different View controllers` for itself to show those dots at the bottom, but right now i have `one View controller` and `three different views`. So is it possible to use Page Controller in my case.? Thanks in advance.

Answer: 
`implode()` is not printing the keys of `$wordsArray` which is why the var `words` doesn't have the correct keys.

What you're really trying to achieve here is a string representation of a PHP array with Javascript syntax. A function that will do that for you is `json_encode()` 

```
<?php echo "var words = ". json_encode($wordsArray) . ";";?>

```

More info here: <http://au2.php.net/json_encode>

And the reason this line doesn't work:

```
echo "<br>".key($wordsArray) . ":" . $wordsArray[$row['chinese']];

```

Is because the `key()` function doesn't move the array pointer, hence you get a repeat of the same array key.
maybe you can try this? 

```
var words = 
[<?php $result = [];
foreach($wordsArray as $key=>$value){
   $result[] = '"'.$key.'":"'.$value.'"';
}
echo implode(',', $result)
?>]

```