PHP code example of contentasaurus / node-php-process

1. Go to this page and download the library: Download contentasaurus/node-php-process library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

contentasaurus / node-php-process example snippets




use contentasaurus\NodePhpProcess;

$process = new NodePhpProcess();
$process
	->script_path(__DIR__)
	->content([
		'test' => 'json'
	])
	->run('errors.js')
	->output($output)
	->errors($errors);

// exit(var_dump($errors));
if(!empty($errors)) {
	trigger_error($errors, E_USER_ERROR);
	exit();
}

exit($output);