Home >Backend Development >PHP Tutorial >php中不能用延续三目的写法吗

php中不能用延续三目的写法吗

WBOY
WBOYOriginal
2016-06-13 11:47:54854browse

php中不能用连续三目的写法吗

<br />($bqr[classid]==7) ? $val=$arrImg[0][$bqno3-1]:<br />($bqr[classid]==8) ? $val=$arrImg[1][$bqno3-1]:<br />($bqr[classid]==9) ? $val=$arrImg[2][$bqno3-1]:<br />($bqr[classid]==10) ? $val=$arrImg[3][$bqno3-1]:false;<br />

------解决方案--------------------
额,抱歉,发帖太少,不会用这个编辑器,代码是这样的
(((($bqr[classid]==7) ? $val=$arrImg[0][$bqno3-1]:($bqr[classid]==8))<br /> ? $val=$arrImg[1][$bqno3-1]:($bqr[classid]==9)) <br /> ? $val=$arrImg[2][$bqno3-1]:($bqr[classid]==10))<br /> ? $val=$arrImg[3][$bqno3-1]:false;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn