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>
运行结果: