由于逗号导致 PHP 逻辑语句语法错误

标签 php

谁能帮忙

<?php 
if(((count( $replies ) > 6) and 
(count( $replies ) <= 12)) and 
($replyNumber == '3','4','5'))
{ ?>
<execute code......>
<?php } ?>

为什么由于使用逗号(在回复编号中为 3,4,5 时出现代码错误

最佳答案

像这样更改您的代码:

<?php 
$varArray = array('3','4','5');
if( ((count( $replies ) > 6) && (count( $replies ) <= 12)) && (in_array($replyNumber,$varArray)) )  { ?>
    <execute code......>
<?php } ?>

关于由于逗号导致 PHP 逻辑语句语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45234306/

相关文章:

php - 意外的基数违规(子查询返回超过 1 行)

php - 可能的字符编码问题?

php - $_SERVER ['HTTP_HOST' ] 本地主机与部署登台服务器不同

php - 将现有站点迁移到 Drupal 之类的 CMS 或 Zend 之类的框架,或者两者都不迁移?

javascript - 第一次点击后是否可以更改 iFrame 样式(不在同一域上)

php - 错误 :The filename try. xlsx 在 excel_reader2.php 中不可读

php - 更新帖子时 Wordpress 重定向到 404

PHPMailer v. mail() 用于简单的联系表单

PHP Paypal IPN 监听器因多个项目而不是单个项目而失败

php - MYSQL 与图像一起使用?