我有這個代碼php與cURL,我需要顯示結果在我的html5應用程序。在電話應用程序中使用cURL的PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.taringa.net/top/posts/?fecha=3&cat=-1');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$resultado = curl_exec($ch);
curl_close($ch);
function parsear($i,$f,$s) {
list($crap,$y) = explode($i,$s,2);
list($x,$shit) = explode($f,$y,2);
return $x;
}
$topPostSemana = trim(strip_tags(parsear('class="icon points">','class="box sticky"', $resultado),'<a><span>'));
$topPostSemana = explode('<span class="number-list">', $topPostSemana);
?>
我如何在html5中顯示結果?我用這個但是PHP不工作在我的應用程序的PhoneGap:
<ul>
<?
foreach ($topPostSemana as $post) {
echo '<li><span class="number-list">'.$post.'</li>';
}
?>
</ul>
我的示例應用程序:http://comercialposadas.com/mobile/app/
當它出現你在下面的評論知道,你知道的PhoneGap不支持PHP。所以相反,你將不得不使用JavaScript和AJAX從網站獲得結果。 –
謝謝,我懷疑,但我不知道如何。也許你可以幫我 – user1706064