size($input)

Determines the size/length of numbers, strings, arrays and countable objects

  • $input (mixed)
  • return (integer)
echo size('my awesome string');
// will echo 17

echo size(15);
// will echo 15

echo size(['a', 'b', 'c']);
// will echo 3

$collection = new Collection(['a', 'b', 'c']);
echo size($collection);
// will echo 3