Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 判断指 指定值输出!

判断指 指定值输出!

Jun 23, 2016 pm 01:51 PM
designation output

<?php$n=$_GET['che'];define("A", $n);if(A==star){echo '1';}else if(A==movie){echo '9';}else if(A==tv){echo '10';}else if(A==yue){echo '10';}else if(A==zongyi){echo '12';}else if(A==news){echo '15';}else if(A==yanchu){echo '13';}else if(A==fashion){echo '20';}else if(A==astro){echo '23';}在这里弄个  统一的值输出$b  这样 echo 里的值全弄到$b去  用B输出?>
Copy after login



回复讨论(解决方案)

$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;
Copy after login

$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']] : ''
Copy after login
Copy after login

$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']] : ''
Copy after login
Copy after login





大哥
Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to output text with line breaks in Go language How to output text with line breaks in Go language Mar 15, 2024 pm 04:15 PM

Go language is a modern, efficient and concise programming language that is widely used in software development in various fields. In the Go language, outputting text with newlines is very simple and can be achieved by using the Println function provided by the fmt package. Below we will introduce in detail how to output text with line breaks in Go language, as well as related code examples. In the Go language, if you want to output text with newlines, you can use the Println function provided by the fmt package. The Println function will output text in

How to fix missing MSVCP140D.dll issue on Windows How to fix missing MSVCP140D.dll issue on Windows Dec 22, 2023 am 10:51 AM

MSVCP140D.dll is a very important resource file. If an error occurs when running the program that MSVCP140D.dll is not specified to run on Windows, then you need to take it seriously, because if you do not handle it properly, the program will not be able to run. MSVCP140D.dll is not specified to run on Windows. Solution: Method 1: First download the msvcp140.dll file, decompress it and copy it to the corresponding system directory (the different directory addresses below correspond to different systems and cannot be mistaken) 1. For Windows95/98/Me system, copy it to the C:\Windows\System directory. 2.Window

xlive.dll is not specified to run on Windows xlive.dll is not specified to run on Windows Jan 06, 2024 pm 07:29 PM

When many friends are playing games, the system suddenly prompts that the program cannot be started because xlive.dll is missing from the computer. Try reinstalling this program to solve this problem. What's going on? It's because the file is missing or not registered. Let's take a look at the specific solutions below. xlive.dll is not specified to run in Windows Solution 1. Start-Run Enter CMD, click OK or press the Enter key on the keyboard to open the administrator command prompt window. 2. Copy: for%1in(%windir%\system32\*.dll)doregsvr32.exe/s%1 command, open the administrator command prompt

What to do if the output video of VideoStudio x10 is too large - How to solve the problem of too large output video of VideoStudio x10 What to do if the output video of VideoStudio x10 is too large - How to solve the problem of too large output video of VideoStudio x10 Mar 04, 2024 pm 05:04 PM

Many people are using the VideoStudio x10 software at work, but do you know what to do if the output video of the VideoStudio x10 is too large? Below, the editor will bring you the solution to the problem of the output video of the VideoStudio x10 being too large. Method, interested users can take a look below. First of all, you need 10 video codecs and X264 video templates for 64-bit VideoStudio x8 and x10. The method is feasible. When installing the x10 video codec, a prompt dialog box may appear, in which the path of the Chinese file may not match, but it does not affect normal use. Then, continue to click Next to complete the installation of the decoder, and then copy the Chinese version of the software to the corresponding place. There are detailed instructions in the Chinese version file, so I won’t go into details here. After successful installation, open x

How to use user input and output functions for data processing in PHP? How to use user input and output functions for data processing in PHP? Jul 25, 2023 pm 04:30 PM

How to use user input and output functions for data processing in PHP? Overview: In PHP, user input and output functions are very important, they allow us to interact with users, and process and display data. This article will introduce how to use PHP's built-in user input and output functions for data processing, and provide relevant code examples. 1. User input function: In PHP, there are many functions that can obtain user input. The following are some of the commonly used functions: $_POST: used to process requests submitted through the POST method.

In-depth analysis of the ECHO output function in PHP In-depth analysis of the ECHO output function in PHP Mar 27, 2024 pm 03:03 PM

In-depth analysis of the ECHO output function in PHP In PHP, ECHO is a function used to output strings. It is widely used in web development for displaying content to users. This article will provide an in-depth analysis of the ECHO output function in PHP, including its usage, features, and some common tips and precautions. 1. Basic usage of the ECHO function In PHP, the ECHO function is used to output one or more strings. Its basic syntax is: echo "Hello, world!&

Which statement in php can output an array Which statement in php can output an array Aug 03, 2023 pm 02:42 PM

Statements for outputting arrays in PHP: 1. Use the "print_r()" function to print variables, including arrays; 2. Use the "var_dump()" function to display detailed information about variables, including type, length and value; 3. Use the echo statement and foreach loop; 4. Use the "implode()" function to concatenate the array values ​​into a string; 5. Use the "json_encode()" function to convert the array to JSON Format string.

How to specify and enforce interface specifications in Python? How to specify and enforce interface specifications in Python? Aug 27, 2023 pm 02:09 PM

Letus first see what isan interface spec.The interface spec isan interface specification for a module provided by programming languages ​​such as C++ and Java. Use isinst

See all articles