我有一個PHP函數,返回的東西:在這裏我想從上面的函數傳遞返回值PHP - 傳遞函數返回另一個函數
function myfunction() {
$array = array('one', 'two', 'three', 'four');
foreach($array as $i) {
echo $i;
}
}
而另一功能:
function myfunction2() {
//how to send myfunction()'s output here? I mean:
//echo 'onetwothreefour';
return 'something additional';
}
我猜它會看起來像myfunction2(myfunction)
,但我不知道PHP太多,我不能讓它工作。
使用在foreach回一點兒也不好聽。因爲它會返回一次並退出函數,所以它不會到達下一個數組項。 – Orhan 2012-02-10 15:35:05
我不明白你的問題。你能更清楚嗎? – DonCallisto 2012-02-10 15:35:12
我的錯,我的意思是「回聲」! – Wordpressor 2012-02-10 15:35:36