Projects
View on GitHub
coduo/php-to-string
About
Cast any php value into a string
Developer ToolsMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalPHP To String
Simple library that converts PHP values into strings.
Status:
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)"
Explore related projects
Loading…