In Codeigniter I have a view `theme-fonts.php` that I am loading in another view `page.php`.

`page.php`

```
<?php $this->load->view('theme-fonts'); ?>
<script type="text/javascript">
    try{
        var fontsArray = <?php json_encode($font_list); ?>;
        console.log(fontsArray);
    }catch(err){
        console.log(err.message);
    }
</script>

```

Following is the definition inside my `theme_fonts.php` file:

```
<link href="http://fonts.googleapis.com/css?family=Aclonica" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Michroma" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Paytone+One" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Denk+One" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Wendy+One" rel="stylesheet" />
<link href="http://fonts.googleapis.com/css?family=Fjalla+One" rel="stylesheet" />
<?php   
    $font_list = array();
    array_push($font_list,"Aclonica");
    array_push($font_list,"Michroma");
    array_push($font_list,"Paytone+One");
    array_push($font_list,"Denk+One");
    array_push($font_list,"Wendy+One");
    array_push($font_list,"Fjalla+One");
?>

```

So my question is how to access php array from view `theme-fonts.php` in main view `page.php`?

Regards: Jehanzeb