php¶ÁÈ¡xml
XML code:
<?xml version="1.0" ?>
- <xml_api_reply version="1">
- <weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
- <forecast_information>
<city data="" />
<postal_code data="" />
<latitude_e6 data="30670000" />
<longitude_e6 data="104019996" />
<forecast_date data="2009-12-24" />
<current_date_time data="2009-12-24 17:00:00 +0000" />
<unit_system data="SI" />
</forecast_information>
- <current_conditions>
<condition data="Îí" />
<temp_f data="43" />
<temp_c data="6" />
<humidity data="滦飼 93%" />
<icon data="/ig/images/weather/cn_fog.gif" />
<wind_condition data="·çÏò£º ±±¡¢·çËÙ£º91 Ã×/Ãë" />
</current_conditions>
- <forecast_conditions>
<day_of_week data="ÖÜËÄ" />
<low data="6" />
<high data="14" />
<icon data="/ig/images/weather/sunny.gif" />
<condition data="Çç" />
</forecast_conditions>
- <forecast_conditions>
Ïà¹ØÎÊ´ð£º
´úÂëÈçÏ£º
function uc_get_user($username, $isuid=0) {
$return = call_user_func(UC_API_FUNC, 'user', 'get_user', array('username'=>$username, 'isuid'=>$isuid));
return UC_CONNECT == 'mysql' ......
PHP code:
$date = '2009-12-25';
$ptn = '/([\d]{4})[- \/](0?[\d]|1[0-2])[-\/ ](0?[\d]|[1-2][\d]|3[0-1])/';
if (preg_match($ptn,$date,$out))
{
print_r($out);exit();
}
½á¹ûΪ:
PHP code:
......
Ôڲɼ¯Ò»¸öÒ³ÃæµÄʱºòͨ³£¶¼ÊÇʹÓÃfile_get_contents($url)
²»¹ý·µ»ØµÄ½á¹ûÓÐʱºò»á²»È«
Èç¹ûÔÚhtmlÖÐʹÓà document.ready,ÔÚÒ³Ãæ×¼±¸ºÃºó£¬Ê¹ÓÃajax¶ÁÈ¡±ðÒ»²¿·ÖµÄÊý¾Ý
ÔÙͨ¹ýÐÞ¸Ähtml±êÇ©µÄÄÚÈÝ£¬¾Í²¿·ÖµÄÊý¾Ý¾ ......
ÇëÎÊ
object(Helper_Uploader_File) {
protected '_file' => array(
'name' => string '4_¹âÓ°_1.jpg' (length=14)
'type ......