웹관련자료(web)/php & ajax 8

그누보드 네이버(naver) smtp 설정

#config.php /* 추가 시작 */ define('G5_SMTP', 'smtp.naver.com'); define('G5_SMTP_PORT', '587'); define('G5_SMTP_SECURE', 'tls'); define('G5_SMTP_USER', 'xxxxxxx@naver.com'); define('G5_SMTP_PW', 'xoxoxo'); /* 추가 끝 */ #./lib/mailer.lib.php #29라인 if (defined('G5_SMTP') && G5_SMTP) { $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = G5_SMTP; // SMTP server if(defined('G5_SMTP_PORT') && G5..

php 문자열 자르기(substr) - 원하는 길이만큼 잘라서 가져오기

php에서 문자열을 잘라서 가져오는 방법에 대해서 알아보겠습니다. 시간에서 시분초만 가져오는 방법을 예로 들어보겠습니다. 시간이 '2022-08-08 08:08:08' 이라고 한다면, 우리가 잘라서 가져오고 싶은 시분초는 '08:08:08' 입니다. $time = '2022-08-08 08:08:08'; $time_s = substr($time,11,8); echo $time_s; 결과는 08:08:08 #설명 substr($time,11,8) 함수의 기능은 $time 문자열에서 11번째 부터, 8개의 문자열을 가져오라는 함수입니다.

PHP 에서 CURL 로 JSON 형식으로 보내고 리턴받기(POST 전송)

$url = " $uuid, "amount" => $amount, "currency" => $currency, "from" => $from, "way" => $way, "to" => $to); $json_data = json_encode($post_date); $flg = curlSend($url, $json_data); if($flg=='Y') { //결과가 "Y" 경우 처리 } else if($flg=='N') { //결과가 "N" 경우 처리 } function curlSend($url, $json_data) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); cu..