var num = document.body.clientWidth;//JS获取屏幕宽度if(num = 1){    ​<?php $width = 1200 ;>}else{    ​<?php $width = 1800 ;>}pS:根据JS获取屏幕的不同宽度给php变量赋值PHP JS