테스트 사이트 - 개발 중인 베타 버전입니다

3자리 콤마 채택완료

대한사랑 5년 전 조회 3,912

<?php echo$list[$i][wr_27] //급여사항 ?>

 

이 코드에 3자리 콤마가 들어가게 하려면 

 

어떻게 수정해야 하나요?

 

고수님들 부탁드립니다

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

B
5년 전

</p>

<p><?php echo number_format($list[$i]['wr_27']); //급여사항 ?></p>

<p>

 

+ number_format()

- https://www.php.net/manual/en/function.number-format.php

 

+ Instruction separation (명령 구분) ... 질문의 경우 ; 생략 가능하긴 하지만...

- https://www.php.net/manual/en/language.basic-syntax.instruction-separation.php

- http://docs.php.net/manual/kr/language.basic-syntax.instruction-separation.php

 

+ 주의! 'wr_27'처럼 지정해주지 않으면 오류입니다.

PHP v7.2 미만 ... Notice: Use of undefined constant ...

PHP v7.2 이상 ... Warning:  Use of undefined constant ...

PHP v8.0 이상 ... Fatal error:  Uncaught Error: Undefined constant ...

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인