정규식으로 환율 구하기
작성자 : 김영철
등록날짜 : 2009.01.15 13:14
지금은 url이 맞지 않지만... 참고로.. <? ini_set("allow_url_fopen", 1); $html = file_get_contents("http://stock.naver.com/world/exchange.html"); $html = preg_replace("|[\n\r]|iU", "", $html); $html = preg_replace("|<[^>]*DADADA[^<]*>|iU", "", $html); $html = preg_replace("|<[\/]?td.*>|iU", "=", $html); $html = preg_replace("|\s|iU", "", $html); $html = preg_replace("|===|iU", "=", $html); preg_match_all("!'F8F8F8'\">(.*)<\/tr>!iU", $html, $res); $real_data = $res[1]; foreach($real_data as $nt) { preg_match_all("|([^= ]*)=|iU", $nt, $tres); $exchange_rate["현찰살때"] = $tres[1][2]; $exchange_rate["현찰팔때"] = $tres[1][3]; $exchange_rate["수표팔때"] = $tres[1][4]; $exchange_rate["송금보낼때"] = $tres[1][5]; $exchange_rate["송금받을때"] = $tres[1][6]; $exchange_rate["매매기준율"] = $tres[1][7]; $exchange_rate["환가료율"] = $tres[1][8]; $exchange_rate["미화환산율"] = $tres[1][9]; $exchange["{$tres[1][1]}"] = $exchange_rate; } echo "<pre>"; var_dump($exchange); echo "</pre>"; ?> |
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
☞자세히보기 |
|
|