coduo/php-to-string 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

coduo/php-to-string

最新稳定版本:3.2.2

Composer 安装命令:

composer require coduo/php-to-string

包简介

Simple library that converts PHP value into strings

README 文档

README

Simple library that converts PHP values into strings.

Status:

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Simple library that allows you to cast any php value into string

Installation

composer require coduo/php-to-string

Usage

Supported types:

  • string
  • integer
  • float/double
  • object
  • callable
  • array
  • resource
use Coduo\ToString\StringConverter;

$string = new StringConverter('foo');
echo $string; // "foo"

$double = new StringConverter(1.12312);
echo $double; // "1.12312"

$integer = new StringConverter(1);
echo $integer; // "1"

$datetime = new StringConverter(new \DateTime());
echo $datetime; // "\DateTime"

$array = new StringConverter(['foo', 'bar', 'baz']);
echo $array; // "Array(3)"

$res = fopen(sys_get_temp_dir() . "/foo", "w");
$resource = new StringConverter($res);
echo $resource; // "Resource(stream)"

统计信息

  • 总下载量: 11.97M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 271
  • 点击次数: 1
  • 依赖项目数: 13
  • 推荐数: 0

GitHub 信息

  • Stars: 270
  • Watchers: 3
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04