tcl和php交互的例子

tcl代码如下:

set a 10
set b 20
set c [expr {$a + $b}]
puts $c

php代码如下:

<!DOCTYPE html>
<html>
    <body>
        <?php
        $array = array();
            function print_procedure ($arg) {
                echo exec("tclsh test.tcl",$array);
            }
            $script_name='test.tcl';
            print_procedure($script_name);
        ?>
    </body>
</html>

运行结果:

发布了27 篇原创文章 · 获赞 20 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_33479881/article/details/85329991
TCL