php 数组怎么小于等于0_PHP 判断某值为 1,数组中含有某元素,为 0 不含有某元素...

如果某值为1,数组的子数组中含有某元素,如果0,那么不含有某元素,大家能否提供一下方法?下面的是我自己写的,由于PHP不是很擅长,求指教

if (ofget_option('themetuts_download_open')==1) {

register_field_group(array (

'id' => 'acf%e4%b8%8b%e8%bd%bd%e6%bc%94%e7%a4%ba',

'title' => '下载演示',

'fields' => array (

array (

'key' => 'field_553a4b55979cd',

'label' => '开启演示以及下载',

'name' => 'post_down_open',

'type' => 'radio',

'instructions' => '请选择本篇文章是否需要开启演示以及下载功能',

'choices' => array (

1 => '是',

0 => '否',

),

'other_choice' => 0,

'save_other_choice' => 0,

'default_value' => 0,

'layout' => 'horizontal',

),

if (of_get_option('themetuts_download_file')==1) {

array (

'key' => 'field_553a4f38ec358',

'label' => '显示资源大小',

'name' => 'post_down_yuan_radio',

'type' => 'radio',

'choices' => array (

1 => '是',

0 => '否',

),

'other_choice' => 0,

'save_other_choice' => 0,

'default_value' => 0,

'layout' => 'horizontal',

),

array (

'key' => 'field_553a4f86ec359',

'label' => '资源大小',

'name' => 'post_down_yuan',

'type' => 'text',

'conditional_logic' => array (

'status' => 1,

'rules' => array (

array (

'field' => 'field_553a4f38ec358',

'operator' => '==',

'value' => '1',

),

),

'allorany' => 'all',

),

'default_value' => '',

'placeholder' => '',

'prepend' => '',

'append' => '',

'formatting' => 'html',

'maxlength' => '',

),

}

if (of_get_option('themetuts_download_update_time')==1) {

array (

'key' => 'field_553a4f9bec35a',

'label' => '显示更新时间',

'name' => 'post_down_update_radio',

'type' => 'radio',

'choices' => array (

1 => '是',

0 => '否',

),

'other_choice' => 0,

'save_other_choice' => 0,

'default_value' => 0,

'layout' => 'horizontal',

),

array (

'key' => 'field_553a4fc8ec35b',

'label' => '资源更新时间',

'name' => 'post_down_update',

'type' => 'date_picker',

'conditional_logic' => array (

'status' => 1,

'rules' => array (

array (

'field' => 'field_553a4f9bec35a',

'operator' => '==',

'value' => '1',

),

),

'allorany' => 'all',

),

'date_format' => 'yymmdd',

'display_format' => 'dd/mm/yy',

'first_day' => 1,

),

}

),

'location' => array (

array (

array (

'param' => 'post_type',

'operator' => '==',

'value' => 'post',

'order_no' => 0,

'group_no' => 0,

),

),

array (

array (

'param' => 'post_type',

'operator' => '==',

'value' => 'page',

'order_no' => 0,

'group_no' => 1,

),

),

),

'options' => array (

'position' => 'normal',

'layout' => 'default',

'hide_on_screen' => array (

),

),

'menu_order' => 40,

));

}

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值