Home php教程 php手册 php next()在服务器上和本地效果不同为什么php.ini可以控制么

php next()在服务器上和本地效果不同为什么php.ini可以控制么

Jun 06, 2016 pm 07:40 PM
next php different Why Effect server local

我把我的程序上传到空间报错了找到原因后发现next()方法好像总是先执行一次似地 foreach ($crs as $k= $value) { $xiang =""; echo key($crs)."br"; if(key($crs)=="name"){ $xiang = 13; }if(key($crs)=="zhiwu"){ $xiang = 14; }if(key($crs)=="tel"){ $xi

我把我的程序上传到空间报错了找到原因后发现next()方法好像总是先执行一次似地 foreach ($crs as $k=> $value) {
$xiang ="";
echo key($crs)."
";
if(key($crs)=="name"){
$xiang = 13;
}if(key($crs)=="zhiwu"){
$xiang = 14;
}if(key($crs)=="tel"){
$xiang = 15;
}if(key($crs)=="email"){
$xiang = 16;
}if(key($crs)=="password"){
$xiang = 17;
}
next($crs);
$lsjl->addlsjl($kuai,$xiang,json_encode($yrs),json_encode($xrs));
}

数据crs =Array ( [name] => 312333 [zhiwu] => 123333 [tel] => 121343333 [email] => 121343333 )

打印出的结果是

服务器

zhiwu
tel
email

本地输出结果

name
zhiwu
tel
email

求帮助

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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 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)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

What is the priority of C language !x? What is the priority of C language !x? Apr 03, 2025 pm 02:06 PM

The logical non-operator (!) has the priority next to parentheses, which means that in expressions, it will precede most other operators. Understanding priority not only requires rote memorization, but more importantly, understanding the logic and potential pitfalls behind it to avoid undetectable errors in complex expressions. Adding brackets can clarify expression intent, improve code clarity and maintainability, and prevent unexpected behavior.

Tutorial on how to represent the greatest common divisor in C language functions Tutorial on how to represent the greatest common divisor in C language functions Apr 03, 2025 pm 11:21 PM

Methods to efficiently and elegantly find the greatest common divisor in C language: use phase division to solve by constantly dividing the remainder until the remainder is 0. Two implementation methods are provided: recursion and iteration are concise and clear, and the iterative implementation is higher and more stable. Pay attention to handling negative numbers and 0s, and consider performance optimization, but the phase division itself is efficient enough.

Best practices for C language default Best practices for C language default Apr 03, 2025 pm 03:48 PM

The best practices of default in C language: place it at the end of the switch statement as the default processing for unmatched values; it is used to handle unknown or invalid values ​​to improve program robustness; avoid duplication with case branches to maintain conciseness; comment clearly on the purpose of the default branch to improve readability; avoid using multiple defaults in one case to maintain clarity; keep the default branch concise and avoid complex operations; consider using enumeration values ​​as case conditions to improve maintainability; in large switch statements, use multiple default branches to handle different situations.

Front-end FileReader file reading: Why do you need to instantiate first and then read? Front-end FileReader file reading: Why do you need to instantiate first and then read? Apr 04, 2025 pm 01:48 PM

Regarding FileReader instantiation and file reading In front-end development, we often need to process files uploaded by users. use

Why does my RxJS code not take effect when operating on streams? Why does my RxJS code not take effect when operating on streams? Apr 04, 2025 pm 06:27 PM

Why doesn't my code take effect when using RxJS to operate on streams? Learning RxJS...

Unused variables in C/C: Why and how? Unused variables in C/C: Why and how? Apr 03, 2025 pm 10:48 PM

In C/C code review, there are often cases where variables are not used. This article will explore common reasons for unused variables and explain how to get the compiler to issue warnings and how to suppress specific warnings. Causes of unused variables There are many reasons for unused variables in the code: code flaws or errors: The most direct reason is that there are problems with the code itself, and the variables may not be needed at all, or they are needed but not used correctly. Code refactoring: During the software development process, the code will be continuously modified and refactored, and some once important variables may be left behind and unused. Reserved variables: Developers may predeclare some variables for future use, but they will not be used in the end. Conditional compilation: Some variables may only be under specific conditions (such as debug mode)

The difference in output results of console.log: Why do the same variables have different printing methods but different results? The difference in output results of console.log: Why do the same variables have different printing methods but different results? Apr 04, 2025 am 11:48 AM

In-depth discussion of the differences in console.log output in this article will analyze the reasons why the output results of console.log function in a piece of code are different. Code snippets involve URL parameter resolution...

See all articles