2014-03-04 32 views
0

即時得到這個錯誤,但無法弄清楚,爲什麼PHP意外「meta_value」(T_STRING)

while($info = mysql_fetch_array($data)) 
{ 
echo itg_fetch_image('.$info['meta_value'].'); //the line giving error 
Print "<tr>"; 
Print "<th>ID:</th> <td>".$info['meta_id'] . "</td> "; 
Print "<th>VALUE:</th> <td>".$info['meta_value']. "</td> "; 
Print "<th>DONE:</th> <td>YES</td> "; 
} 

如果我註釋掉這一行就顯示了價值TD精細,香港專業教育學院嘗試了一切。把註釋刪除,然後添加「」。 itg_fetch_image是http://www.intechgrity.com/automatically-copy-images-png-jpeg-gif-from-remote-server-http-to-your-local-server-using-php/#

代碼彪是回聲itg_fetch_image(「網址」)和所有meta_values返回一個URL字符串

+4

'回聲itg_fetch_image($信息[ 'meta_value']);'。報價是不必要的。 –

+0

工作,因爲你說它首先發布它作爲答案,我會接受。謝謝 – mxadam

+0

由於問題已關閉,因此無法進行。隨意選擇第一個正確的答案,因爲他們也應該得分。 –

回答

2

引號的回聲線造成問題的原因。 它應該是這樣的:

echo itg_fetch_image($info['meta_value']); 
0

似乎itg_fetch_image()是一個函數

試試這個:

echo itg_fetch_image($info['meta_value']); 

你可以通過變量。不需要使用引號。

0

你必須把它寫成

echo itg_fetch_image($info['meta_value']);