size($input)

Returns the size of strings, numbers, files and arrays.

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

echo size(15);
// will echo 15

echo size('/some/file/on/the/server/which/has/1kb.jpg');
// will echo 1024

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