定制 mcaskill/php-get-var-type 二次开发

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

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

mcaskill/php-get-var-type

Composer 安装命令:

composer require mcaskill/php-get-var-type

包简介

Get the type, resource name, or class name of a variable.

关键字:

README 文档

README

(PHP 5 >= 5.4)
get_var_type — Get the type, resource name, or class name of a variable.

Description

string get_var_type( mixed &$var )

Returns the type (name if an object or resource) of the PHP variable var.

Based on Pavel Lang's get_type() function.

Parameters

  • var — The variable being type checked.

Return Values

If the given var is:

  • a resource, this function will return the value from get_resource_type()
  • an object, this function will return the value from get_class()
  • else, this function will return the value from gettype()

Examples

Example #1 get_var_type() example

$data = array(1, 1., NULL, new ArrayIterator, 'foo', mysql_connect());

foreach ($data as $value) {
    echo gettype($value), "\n";
}

The above example will output something similar to:

integer
double
NULL
ArrayIterator
string
mysql link

Installation

With Composer

$ composer require mcaskill/php-get-var-type

Without Composer

Why are you not using composer? Download Function.Fallback.php from the gist and save the file into your project path somewhere.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固