我必須改變RON tu EUR ang的價格,並在我的操作中獲得0
。
我使用的代碼:
include('./panou/simple_html_dom.php');
function euro() {
$dom= file_get_html("http://www.cursvalutar.ro/");;
foreach ($dom->find('tr') as $node) {
if (is_a($node->children(1), 'simple_html_dom_node')) {
if ($node->children(1)->plaintext == "Euro") {
$plain = explode(',', $node->children(2)->plaintext);
if(!isset($plain[0])!== false) {
echo("Nu are");
}
elseif(stripos($plain[0], $plain[0])!== false{
"4.30"
}
}
}
}
$plain[0]*=$koyos; echo "$plain[0]";}
$plain[0] = 4.3780
和$koyos = 545.66
腳本的結果是0
這真的是一個PHP代碼?如果是這樣,那麼if(...){「4.30」}'後面的推理是什麼?如果某件事情是真的,創建和丟棄字符串文字有什麼意義? ...不用介意丟失的右括號。 – 2013-02-23 08:33:29
@Jan Dvorak:因爲「爲什麼不呢?」 – zerkms 2013-02-23 08:34:29
包含語法錯誤(在Cthulhu編輯後可見)。關閉太過本地化? – 2013-02-23 08:35:31