Lua::assign

(PECL lua >=0.9.0)
Assign a PHP variable to Lua
public mixed Lua::assign ( string $name, string $value )
Parameters:
name
value
Returns:

Returns $this or NULL on failure.

This function is currently not documented; only its argument list is available.

Examples:
Lua::assign() example
<?php
$lua = new Lua();
$lua->assign("php_var", array(1=>1, 2, 3)); //lua table index begin with 1
$lua->eval(<<<CODE
    print(php_var);
CODE
);
?>

The above example will output:

Array
 (
     [1] => 1
     [2] => 2
     [3] => 3
 )
doc_php
2016-02-24 16:06:09
Comments
Leave a Comment

Please login to continue.