채택완료

3자리 콤마

2020-08-25 (화) 18:37:24 4,368

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

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

어떻게 수정해야 하나요?

고수님들 부탁드립니다

|

답변 2개

2020-08-25 (화) 20:16:31
Copy
<?php echo number_format($list[$i]['wr_27']); //급여사항 ?>

+ 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 ...

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