我目前正在用PHP和python搞砸。我做了一個簡單的Python腳本這實際上只是 - print "Hello World"
php只返回數組中的變量到網頁
我的PHP腳本(這是在我的主要的index.php頁)如下:
<?php
$output = null;
exec('C:\\Python27\\python.exe py\\test.py', $output, $return);
print_r($output);
?>
我的問題是,它返回:
陣列([0] =>的Hello World)
有誰知道如何只返回Hello World
到我的網頁? 任何幫助將不勝感激。
讀http://php.net/manual/en/function.exec.php – 2012-03-31 21:24:22
中繼()可能http://www.php.net/manual/en/function.passthru.php – 2012-03-31 21:24:36
Yeesh我覺得自己是個笨蛋......謝謝你們兩個。 – Meh 2012-03-31 21:26:51