CakeFest 2024: The Official CakePHP Conference

Lua::assign

(PECL lua >=0.9.0)

Lua::assignPHP 変数を Lua にアサイン

説明

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

警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

パラメータ

name

value

戻り値

$this、あるいは失敗した場合に null を返します。

例1 Lua::assign()の例

<?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
);
?>

上の例の出力は以下となります。

Array
 (
     [1] => 1
     [2] => 2
     [3] => 3
 )
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top