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

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

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

gregorj/to-string

Composer 安装命令:

composer require gregorj/to-string

包简介

A simple PHP library for turning values into readable strings.

README 文档

README

License: MIT

This is a simple PHP library for turning values into readable strings. Its main purpose is to make strings and byte data printable by escaping non-printable characters instead of returning raw control bytes. This means, binary data is supported.

The library currently provides helpers for:

  • booleans
  • bytes
  • strings
  • arrays
  • generic mixed values

Installation

composer require gregorj/to-string

Usage

<?php

use GregorJ\ToString\ToString;

echo ToString::fromAny(true);
// true

echo ToString::fromAny("hello\nworld");
// hello\nworld

echo ToString::fromAny(['name' => 'Hello', 'value' => 2.7, 'nothing' => null]);
// [name: "Hello", value: 2.7, nothing: null]

echo ToString::fromAny(new stdClass());
// stdClass

Limitations

  • Array output is currently designed for human readability, not for parsing back into PHP.
  • Recursive/self-referencing arrays are currently not supported.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固