PHPackages                             trc/phpexecjs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. trc/phpexecjs

ActiveLibrary

trc/phpexecjs
=============

Run JavaScript code from PHP

v3.0.0(6y ago)05MITPHP

Since Feb 13Pushed 6y agoCompare

[ Source](https://github.com/the-red-corner/phpexecjs)[ Packagist](https://packagist.org/packages/trc/phpexecjs)[ RSS](/packages/trc-phpexecjs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (16)Used By (0)

PhpExecJs
=========

[](#phpexecjs)

PhpExecJS lets you run JavaScript code from PHP.

Short example:

```
print_r($phpexecjs->evalJs("'red yellow blue'.split(' ')"));

```

Will print:

```
Array
(
    [0] => red
    [1] => yellow
    [2] => blue
)

```

[![Build Status](https://camo.githubusercontent.com/60fd06f56f916518cd5a7d6498b8466e95e6cc872a81a39c8d8de08e09d0e9c9/68747470733a2f2f7472617669732d63692e6f72672f6e61636d617274696e2f706870657865636a732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/nacmartin/phpexecjs)[![Latest Stable Version](https://camo.githubusercontent.com/62e277a3e24c3b716088ff610c36730edeba7e6715043f36955fb46643c8fac7/68747470733a2f2f706f7365722e707567782e6f72672f6e61636d617274696e2f706870657865636a732f762f737461626c65)](https://packagist.org/packages/nacmartin/phpexecjs)[![Latest Unstable Version](https://camo.githubusercontent.com/375237f93194aeb9ceb6ecd13ea1164d7b61eeb10b1b2a4b599ed1e79356211e/68747470733a2f2f706f7365722e707567782e6f72672f6e61636d617274696e2f706870657865636a732f762f756e737461626c65)](https://packagist.org/packages/nacmartin/phpexecjs)[![License](https://camo.githubusercontent.com/ca36d54dd142617f58f41fab23d6bac295eb68d2f064b6e2be94b6bcefed219c/68747470733a2f2f706f7365722e707567782e6f72672f6e61636d617274696e2f706870657865636a732f6c6963656e7365)](https://packagist.org/packages/nacmartin/phpexecjs)

Installation
============

[](#installation)

```
composer require nacmartin/phpexecjs

```

Sample program

Usage
=====

[](#usage)

```
