method cast documentation in bbn\Str

Converts any type of variable to a string.

Example

$st = 122 X::dump(\bbn\Str::cast($st)); // (string) "122" X::dump(\bbn\Str::cast(1)); // (string) "1" X::dump(\bbn\Str::cast(['foo' => 'bar']) // (string) "" function($st) { if (is_array($st) || is_object($st)) { return ''; } if (is_string($st)) { return normalizer_normalize($st); } return (string)$st; }

Converts any type of variable to a string. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.