반응형 Old181 simplexml error handling 만약 simple_load_string 또는 simpe_load_file로 에러가 발생했을 시, 핸들링하는 방법 $use_errors = libxml_use_internal_errors(true); $xml = simplexml_load_file($url); if (!$xml) { //throw new Exception("Cannot load xml source.\n"); } libxml_clear_errors(); libxml_use_internal_errors($use_errors);참고 사이트 : http://stackoverflow.com/questions/1307275/simplexml-error-handling-php 2013. 3. 21. phpmailer phpmailer download site : http://phpmailer.worxware.com/홈페이지를 제작하다 보면 mail을 발송할 때가 많이 발생합니다. 하지만 현재 사용 중인 웹 서버가화이트 도메인이 아닌 경우와 메일서버(sandmail, qmail 등)이 설치되어 있지 않은 경우에는PHPMailer를 이용해서 구글(Gmail)이나 네이버, 구글, 다음, 네이트 등의 SMTP를 사용하면 쉽게 해결될 수 있는 문제입니다. 일단 단점부터 말하자면 SSL을 통하여 인증 받는 방식이라 인증 받는 단계에 시간이 제법 걸립니다.그러므로 발송 시 시간 제법 지연됩니다.(약 3~5초 정도) 장점은 네이버, 구글, 다음, 네이트 등의 서버가 스팸메일로 등록될 가능성이 매우 희박하므로 화이트 도메인과웹 메일.. 2013. 3. 21. [Source Tree]pull 시 오류 메세지 error: Your local changes to the following files would be overwritten by merge:Please, commit your changes or stash them before you can merge.Aborting Completed with errors, see above. 에러가 날 경우 rebasehttp://git-scm.com/book/ko/Git-%EB%B8%8C%EB%9E%9C%EC%B9%98-Rebase%ED%95%98%EA%B8%B0http://dogfeet.github.com/articles/2012/git-merge-rebase.html 2013. 3. 19. WeatherBug 날씨 야후 날씨 API, Wunderbug 날씨 API, WeatherBug를 비교해본 결과 Weatherbug가 지닌 장점이 많아 Weatherbug에서 제공해주는 API를 사용하여 7일 기상 정보를 가져왔다. 개발 문서 제공 사이트 : http://developer.weatherbug.com/ weather bug의 예 :http://api.weatherbug.com/api/examples.asp일주일 기상정보 제공 APIhttp://i.wxbug.net/REST/SP/getForecastRSS.aspx?api_key=weatherbug에서 제공 받은 api 키&lat=위도&long=경도&UnitType=1&OutputType=0UnitType가 0일 경우 화씨(default), 1일 경우 섭씨Output.. 2013. 3. 18. 특정 문자열 사이에 있는 값 가져오기 ex) $str="우리아기 물티슈 natural 내추럴"라는 문장에서 물티슈만 가져오려고 할 때strpos로 "우리아기","natural"가 처음 등장하는 문자열 위치를 찾는다.$a=strpos($str,"우리아기")$b=strpos($str,"natural")$c=$b-$asubstr($str,$a,$len); 2013. 3. 15. 이전 1 ··· 30 31 32 33 34 35 36 37 다음 반응형