欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

判断指 指定值输出!

程序员文章站 2022-05-22 11:34:03
...



回复讨论(解决方案)

$n=$_GET['che'];define("A", $n);$b = '';if(A=='star'){$b = '1';}else if(A=='movie'){$b = '9';}else if(A=='tv'){$b = '10';}else if(A=='yue'){$b = '10';}else if(A=='zongyi'){$b = '12';}else if(A=='news'){$b = '15';}else if(A=='yanchu'){$b = '13';}else if(A=='fashion'){$b = '20';}else if(A=='astro'){$b = '23';}echo $b;

$dict = array(  'star' => '1',  'movie' => '9',  'tv' => '10',  'yue' => '10',  'zongyi' => '12',  'news' => '15',  'yanchu' => '13',  'fashion' => '20',  'astro' => '23',);echo isset($dict[$_GET['che']]) ? $dict[$_GET['che']] : ''

$dict = array(  'star' => '1',  'movie' => '9',  'tv' => '10',  'yue' => '10',  'zongyi' => '12',  'news' => '15',  'yanchu' => '13',  'fashion' => '20',  'astro' => '23',);echo isset($dict[$_GET['che']]) ? $dict[$_GET['che']] : ''




大哥