숫자열를 문자열로 처리하려면 ? 채택완료
블레스
9년 전
조회 2,374
모니터를 넓이 값을 스크립트로 받아서 계산을 할려고 합니다.
그런 문제는 모니터 넓이값이 스크립트로 받아서 그런지 문자열로 처리되는것 같습니다.
숫자열로 바꾸는 함수(방법)이 있을까요?
</p><p>$screen_width = "<script>document.write(window.screen.width);</script>"; // 디바이스 넓이
$table_width = $screen_width; //모니터 해상도 값 1920
$padding_width = 50;</p><p>$real_width = $table_width + $padding_width;
echo "$real_width"; //헐 50으로 출력됨, 1970이 되야 하는데
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
9년 전
여기를 참조해서 보세요..
http://stackoverflow.com/questions/10009040/getting-screen-width-into-javascript-variable-and-sending-it-through-ajax-to-a-p">http://stackoverflow.com/questions/10009040/getting-screen-width-into-javascript-variable-and-sending-it-through-ajax-to-a-p
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인