하나 외환은행 환율 parser를 이용한 php 파싱하기
http://simplehtmldom.sourceforge.net/
find('dd[id=dispTime]') as $dd_txt) { $insert_time = $dd_txt; } //기준일 foreach($html->find('dd[id=regdt]') as $dd_txt) { $insert_date = $dd_txt; } $txt_array = array(); // find all td tags with attribite align=center foreach($html->find('table[class=tbl_list_type2]') as $tb_txt){ //echo $tb_txt->innertext." "; $k = 1; foreach($tb_txt->find('tr') as $tr_txt) { //echo $tr_txt->innertext." "; $i = 1; foreach($tr_txt->find('td') as $td_txt) { $txt_array[$i] = strip_tags($td_txt->innertext); if($k=="3" && $i=="10"){ $insert_thb = strip_tags($td_txt->innertext); } $i++; } $k++; } } if($type=="date"){ return $insert_date; }else if($type=="time"){ return $insert_time; }else if($type=="price"){ return $insert_thb; } } echo "기준일:".s_price_baht("date"). "고시시간:".s_price_baht("time"). "매매 기준율:".s_price_baht("price"); ?>