phpjavascriptframeworksphpjs

Integration with PHP.js Javascript library


I am attempting to integrate the PHPJS (http://phpjs.org/) library with some code and am having trouble calling any of the functions and the library's websites does not have a step-by-step for getting started.

I am using the base download php.default.min.js and have created a bare bones page:

<html>
<head>
<script type="text/javascript" src="php.default.min.js"></script>
<script type="text/javascript">
alert(phpversion());
</script>
</head>
<body></body>
</html>

I would expect that to produce a JavaScript alert but I only get a JS error of:

Uncaught ReferenceError: phpversion is not defined.

How do I go about utilizing the functions in the PHP.js library?


Solution

  • you're using the default package, which doesn't come with the phpversion function. Try using the full package. Both releases have a list of supported functions in the links I've attached.

    Hope it helps!