定制 aelora/truthy 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aelora/truthy

最新稳定版本:1.0.1

Composer 安装命令:

composer require aelora/truthy

包简介

Add a simple isTruthy and isFalsy function to see if things are true-like or false-like

README 文档

README

isTruthy / isFalsy

Latest Version on Packagist Total Downloads

Simple PHP package to add an isTruthy and isFalsy function.

And yes, I know this is simple to almost a silly level. But it's something that I found myself adding to a bunch of different PHP projects so it seemed like a perfect bit of code to build into a package.

Installation

Install using composer

composer require aelora/truthy

There are no settings.

Usage

Once loaded, there will be an isTruthy and isFalsy function in the global namespace.

The following values are considered falsy

  • false
  • null
  • empty string
  • 0
  • 0.0
  • empty array
  • empty object
  • strings "no", "n", "false", "f", "off", "null", "0", "0.0"

Everything else is considered truthy.

if (isTruthy($value)) {
    // Do something
} 
if (isFalsy($value)) {
    // Do something
}

Tests

composer test

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固