note 128267 added to v8js.examples
| From: | nabikaz at gmail dot com | Date: | Thu, 02 Mar 2023 02:09:33 +0000 |
| Subject: | note 128267 added to v8js.examples | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220224@lists.php.net to get a copy of this message | ||
If you want the output of the JS code not to be printed in the output and have it in PHP:
<?php
// Create a new V8Js object
$v8 = new V8Js();
// Define a JavaScript function
$JS = <<<EOT
(function() {
return 'Hello World!';
})();
EOT;
// Execute the JavaScript function using V8js
$result = $v8->executeString($JS);
// Output the result
var_dump($result);
?>
Output:
string(12) "Hello World!"
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 91.98.48.3)
----
Manual Page -- https://php.net/manual/en/v8js.examples.php
Edit -- https://main.php.net/note/edit/128267
Del: integrated -- https://main.php.net/note/delete/128267/integrated
Del: useless -- https://main.php.net/note/delete/128267/useless
Del: bad code -- https://main.php.net/note/delete/128267/bad+code
Del: spam -- https://main.php.net/note/delete/128267/spam
Del: non-english -- https://main.php.net/note/delete/128267/non-english
Del: in docs -- https://main.php.net/note/delete/128267/in+docs
Del: other reasons-- https://main.php.net/note/delete/128267
Reject -- https://main.php.net/note/reject/128267
Search -- https://main.php.net/manage/user-notes.php