특수문자 ????? DB에 기록하는 방법 채택완료
타버린나무
3년 전
조회 3,671
</p>
<p><?php
include_once('../../common.php');</p>
<p> define('cherry', 0);
define('orange', 1);
define('prune', 2);
define('bell', 3);
define('seven', 4);
define('bar1', 5);
define('bar2', 6);
define('bar3', 7);
define('anyBar', 8);</p>
<p> if($member['mb_point'] < 10) {
alert('슬롯머신 배팅에 필요한 포인트가 없습니다.', '/');
}</p>
<p> insert_point($member['mb_id'], -10, 'Vegas플레이 비용');</p>
<p> $profits = array(
array(10, 30, 120), // cherry
array(0, 0, 100), // orange
array(0, 0, 200), // prune
array(0, 0, 500), // bell
array(0, 0, 5000), // seven
array(0, 0, 300), // bar1
array(0, 0, 2000), // bar2
array(0, 0, 4000), // bar3
array(0, 0, 80) // anybar
);</p>
<p> $slotName = array(
'?',
'?',
'?',
'?',
'?',
'1️',
'2️',
'3️',
);</p>
<p> $slots = array(
array(
cherry, orange, cherry, bar2, prune, bar1, bell, orange,
cherry, orange, bar3, prune, cherry, bell, bar1, orange,
cherry, seven, prune, orange, cherry
),
array(
orange, cherry, bar1, prune, orange, bar2, bell, cherry,
bar3, orange, bar1, prune, cherry, orange, bell, bar2,
seven, cherry, bar1, prune, orange, cherry
),
array(
orange, cherry, bar1, bell, bar3, prune, orange, bar2,
cherry, prune, bell, seven, bar1, bar3, orange, bar2,
cherry, bell, prune, bar1, orange
)
);</p>
<p> $maxSpin = array(20, 21, 20);
$spin = array();
$spin[0] = rand(0, $maxSpin[0]);
$spin[1] = rand(0, $maxSpin[1]);
$spin[2] = rand(0, $maxSpin[2]);</p>
<p> $matchCount = 0;
$matched = $slots[0][$spin[0]];
if($matched == $slots[1][$spin[1]]) {
$matchCount++;
} else if(($matched > seven) && ($slots[1][$spin[1]] > seven)) {
$matched = anyBar;
$matchCount++;
}
if($matched == $slots[2][$spin[2]]) {
if($matchCount > 0) $matchCount++;
} else if(($matched > seven) && ($slots[2][$spin[2]] > seven)) {
if($matchCount > 0) {
$matched = anyBar;
$matchCount++;
}
}
if($profits[$matched][$matchCount] != 0) {
insert_point($member['mb_id'], $profits[$matched][$matchCount], G5_TIME_YMD.' Vegas플레이 수익 ['.$slotName [$slots[0][$spin[0]]].$slotName [$slots[1][$spin[1]]].$slotName [$slots[2][$spin[2]]].']');
}</p>
<p> echo '{"slot1":'.$spin[0].',"slot2":'.$spin[1].',"slot3":'.$spin[2].'}'; </p>
<p>
출처: https://sir.kr/g5_plugin/9824
위 소스에서 특수문자 ????? 가 디비에 기록될때는 2022-02-21 Vegas플레이 수익 [???]로 나옵니다.

숫자 1,2,3은 제대로 기록되고 특수문자만 디비에 기록될때 ? 물음표로 기록되던데
검색으로 찾을수가 없어서 질문드려봅니다.
특수문자를 db에 제대로 넣고 보여주려면 어떻게 해야하나요..
아래는 테이블 구조입니다. 혹시 필요한 정보일까 싶어서요.

추가:
질문 글쓸때는 특수문자가 잘 보이더니.. 저장하고 나니 물음표로 나오는군요.. 사진으로 올립니다

위 그림문자가 다 ???? 로 나온겁니다. ㅜㅜ;
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인

