推荐一个用php编写的生成php代码的引擎
给你看一下官方hello world的demo
<?php
include './metaPHP/include.php';//引入metaPHP
$metaApi = new phpInterpreter('');
$metaApi->codeMeta = array(
'type'=>'window',
'child'=>array(
array(
'type'=>'phpBegin'
),
array(
'type'=>'echo',
'value'=>array(
'type'=>'string',
'data'=>'Hello World',
),
)
),
);
print_r($metaApi->getCode());//获得生成的php代码
详细介绍如下
http://www.cnblogs.com/wanghaoran5555/articles/7569941.html
github地址
https://github.com/13601313270/metaPHP