Home Backend Development PHP Tutorial PHP这个语句是什么意思呢解决思路

PHP这个语句是什么意思呢解决思路

Jun 13, 2016 am 10:05 AM
amp new pm

PHP这个语句是什么意思呢
!$status && $status = $pm['msgtoid'] && $pm['new'];

PHP这个语句是什么意思呢

------解决方案--------------------
!$status && $status = $pm['msgtoid'] && $pm['new'];

如果 !$status == 1 (即 $status == 0)
并且 $status = $pm['msgtoid'] (赋值后的$status不为0)
并且 $pm['new']不为0

那么。。。。。
------解决方案--------------------
!$status && $status = $pm['msgtoid'] && $pm['new'];
!$status返回一个BOOL值,表示非$status
非$status为真的时候才会执行后面的赋值操作。
$status = $pm['msgtoid'] && $pm['new'];
$pm['msgtoid'] && $pm['new']返回的也是BOOL值。
只有当$pm['msgtoid']和$pm['new']都不为空,不等于0,不等于false,不为NULL,时才返回true.
------解决方案--------------------
!$status && $status = $pm['msgtoid'] && $pm['new'];
运算顺序:
(!$status) && ($status = $pm['msgtoid'] && $pm['new']);
等于 (!$status) && $pm['msgtoid'] && $pm['new'];
这样写是将$pm['msgtoid'] && $pm['new']的运算结果在赋值给$status, 可能是为了下面程序的使用,要么就是蛋疼

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

NGINX PM2 VPS: Building a secure web application server NGINX PM2 VPS: Building a secure web application server Sep 28, 2023 pm 05:34 PM

NGINXPM2VPS: Building a secure web application server With the development of the Internet, web applications have become more and more important in our lives. In order to ensure the stability and security of our web application, we need a reliable web server. In this article, we will explain how to set up a secure web application server on a VPS using NGINX and PM2. The first step is to choose the right VPS (VirtualPrivateServer)

Teach you how to deploy NGINX and PM2 on a VPS server Teach you how to deploy NGINX and PM2 on a VPS server Sep 27, 2023 pm 01:25 PM

Teach you how to deploy NGINX and PM2 on a VPS server. Preface: The deployment of a VPS server is one of the key steps for a website or application. Here, I will introduce to you how to deploy NGINX and PM2 on a VPS server. These two tools can greatly improve the performance and stability of the website. This article will introduce the installation and configuration process in detail and provide specific code examples. Install NGINX: First, we need to install NGINX as our web server. 1.1 Update apt-get package management

What coin is AMP? What coin is AMP? Feb 24, 2024 pm 09:16 PM

What is AMP Coin? The AMP token was created by the Synereo team in 2015 as the main trading currency of the Synereo platform. AMP token aims to provide users with a better digital economic experience through multiple functions and uses. Purpose of AMP Token The AMP Token has multiple roles and functions in the Synereo platform. First, as part of the platform’s cryptocurrency reward system, users are able to earn AMP rewards by sharing and promoting content, a mechanism that encourages users to participate more actively in the platform’s activities. AMP tokens can also be used to promote and distribute content on the Synereo platform. Users can increase the visibility of their content on the platform by using AMP tokens to attract more viewers to view and share

VPS Server Optimization: Best Practices for NGINX and PM2 VPS Server Optimization: Best Practices for NGINX and PM2 Sep 26, 2023 am 09:25 AM

VPS Server Optimization: Best Practices for NGINX and PM2, Specific Code Examples Required Summary: Server configuration and optimization play a vital role when building and deploying web applications. This article will introduce how to optimize the performance and reliability of your VPS server by using NGINX and PM2. We will cover the installation and configuration of NGINX and PM2 in detail, and provide specific code examples to help readers understand best practices. Introduction: As web applications grow, servers handle large numbers of concurrent requests

NGINX PM2 VPS: Building a resilient application service infrastructure NGINX PM2 VPS: Building a resilient application service infrastructure Sep 27, 2023 pm 03:49 PM

NGINXPM2VPS: Building a flexible application service infrastructure requires specific code examples. With the development of the Internet and the increase in application requirements, building a flexible application service infrastructure has become an important technical challenge. NGINX, PM2 and VPS (VirtualPrivateServer), as three important technical components, can help us achieve high availability and high performance application deployment and management. This article describes how to use these three components to build a resilient application service infrastructure and

what does pm mean what does pm mean Aug 10, 2023 am 11:03 AM

PM is the abbreviation of Project Manager, which means project manager. A project manager is a professional role in managing projects. It is particularly important in fields such as software development. It is responsible for the planning, organization, management and supervision of projects, and requires a variety of abilities, including Management, communication, leadership, and technical knowledge to ensure projects are delivered on time, within budget, and meet quality standards.

Teach you how to use NGINX and PM2 to deploy Node.js applications on VPS servers Teach you how to use NGINX and PM2 to deploy Node.js applications on VPS servers Sep 26, 2023 pm 05:54 PM

Teach you how to use NGINX and PM2 to deploy Node.js applications on VPS servers. Today I will introduce to you how to use NGINX and PM2 to deploy Node.js applications on VPS servers. Node.js is a very popular back-end development framework, while NGINX is a high-performance reverse proxy server and PM2 is a powerful process manager. By using these three tools together, we can achieve efficient and stable server deployment. Make sure you have Node.js installed

A concise tutorial: How to improve website performance with NGINX and PM2 on VPS A concise tutorial: How to improve website performance with NGINX and PM2 on VPS Sep 27, 2023 am 11:25 AM

Concise tutorial: How to use NGINX and PM2 on VPS to improve website performance Introduction: In the modern network environment, high-performance websites have become the goal pursued by users. In order to provide better user experience and response speed, we can optimize website performance by using NGINX and PM2. This article will detail how to configure NGINX and PM2 on a VPS and provide specific code examples. Install and configure NGINX First, we need to install NGINX on the VPS. Generally speaking, it can be guaranteed by

See all articles