• PHP Video Tutorials

PHP - Lua::assign() Function



Lua::assign() function can assign a PHP variable to Lua.

Syntax

public mixed Lua::assign( string $name , string $value )

Lua::assign() function can return $this or NULL on failure.

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
   );
?>
php_function_reference.htm
Advertisements