Home > Backend Development > PHP Tutorial > zen cart中一条语句的用法

zen cart中一条语句的用法

WBOY
Release: 2016-06-23 14:25:00
Original
912 people have browsed it

在zencart公共配置文件中出现以下代码,请求看一下!有没有人认识这到底是做什么用的!

$contaminated = (isset($_FILES['GLOBALS']) || isset($_REQUEST['GLOBALS'])) ? true : false;

麻烦说的详细点!高结分!


回复讨论(解决方案)

当传入的参数中含有名为 GLOBALS 的项时,$contaminated 就为 真

这种是三元表达式
$contaminated = (isset($_FILES['GLOBALS']) || isset($_REQUEST['GLOBALS'])) ? true : false;
相当于
if(isset($_FILES['GLOBALS']) || isset($_REQUEST['GLOBALS'])){
    $contaminated = true;
}else{
    $contaminated = false;
}

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template