Stap 5: Bonus Feature: Twilio
----------------------------------------------------------------------------------------------------------------
<? php
curl-bron maken
$ch = curl_init();
url instellen
curl_setopt ($ch, CURLOPT_URL, "http://www.snowbird.com/index.html");
de overdracht als een tekenreeks retourneren
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$output bevat de output string
$output = curl_exec($ch);
Sluit curl resource systeembronnen vrijmaken
curl_close($CH);
$output = trim($output);
$twentyfour = ontploffen ('24 hr: < b >< tekstkleur "FBE075" = > ", $output);
$twentyfour = ontploffen (' </lettertype >< /b >', $twentyfour[1]);
$fortyeight = ontploffen ('48 hr: < b >< tekstkleur "FBE075" = > ", $output);
$fortyeight = ontploffen (' </lettertype >< /b >', $fortyeight[1]);
$ytd = ontploffen ('YTD: < b >< tekstkleur "FBE075" = > ", $output);
$ytd = ontploffen (' </lettertype >< /b >', $ytd[1]);
echo "<? xml version=\"1.0\ "encoding = \"UTF-8\"? > \n";
echo "< reactie >< zeggen > Snowbird Resort had". $twentyfour [0]. "duim in de afgelopen vierentwintig uur". $fortyeight [0]. "duim in de afgelopen achtenveertig uur, en". $ytd [0]. "inch jaar tot datum. < / zeggen >< / reactie >";
? >
----------------------------------------------------------------------------------------------------------------