An extensible PHP port of the Linux Cowsay utility.
CowSay will update to stay in step with the latest, actively supported PHP version. See the official PHP list of supported versions.
$ composer require Gipetto/CowSay
<?php
use CowSay\Cow;
$bessie = new Cow("Hello, Farm!");
// store the output in a variable
$output = $bessie->say();
echo $output;
// or just echo the object for direct output
echo $bessie;
-------------------------------
/ How now brown \CowSay\Bear. \
| I support the following Traits: |
\ • Eyes /
-------------------------------
\
\ _ _
(o\---/o)
( . . )
_( (T) )_
/ / \ \
/ / \ \
\_) (_/
\ _ /
_) | (_
(___,'.___)
-------------------------------
/ How now brown \CowSay\BorgCow. \
| I support the following Traits: |
| • Eyes |
| • Tongue |
| • Udder |
\ • Poop /
-------------------------------
\ ^__^
\ (==)\_______
(__)\ )\/\
||----w |
|| || oOo
-------------------------------
/ How now brown \CowSay\Cow. \
| I support the following Traits: |
| • Eyes |
| • Tongue |
| • Udder |
\ • Poop /
-------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| || oOo
-------------------------------
/ How now brown \CowSay\CrazyCow. \
| I support the following Traits: |
| • Eyes |
| • Tongue |
| • Udder |
\ • Poop /
-------------------------------
\ ^__^
\ (oO)\_______
(__)\ )\/\
U ||----w |
|| || oOo
--------------------------------
/ How now brown \CowSay\GreedyCow. \
| I support the following Traits: |
| • Eyes |
| • Tongue |
| • Udder |
\ • Poop /
--------------------------------
\ ^__^
\ ($$)\_______
(__)\ )\/\
||----w |
|| || oOo
----------------------------------
/ How now brown \CowSay\ParanoidCow. \
| I support the following Traits: |
| • Eyes |
| • Tongue |
| • Udder |
\ • Poop /
----------------------------------
\ ^__^
\ (@@)\_______
(__)\ )\/\
||----w |
|| || oOo
----------------------------
/ How now brown \CowSay\Sheep. \
\ I don't support any Traits. /
----------------------------
\
\
__
UooU\.'@@@@@@`.
\__/(@@@@@@@@@@)
(@@@@@@@@)
`YY~~~~YY'
|| ||
-----------------------------------
/ How now brown \CowSay\SurprisedCow. \
| I support the following Traits: |
| • Eyes |
| • Tongue |
| • Udder |
\ • Poop /
-----------------------------------
\ ^__^
\ (OO)\_______
(__)\ )\/\
||----w |
|| || oOo
---------------------------
/ How now brown \CowSay\Tux. \
\ I don't support any Traits. /
---------------------------
\
\
.--.
|o_o |
|:_/ |
// \ \
(| | )
/'\_ _/`\
\___)=(___/
----------------------------------
/ How now brown \CowSay\YouthfulCow. \
| I support the following Traits: |
| • Eyes |
| • Tongue |
| • Udder |
\ • Poop /
----------------------------------
\ ^__^
\ (..)\_______
(__)\ )\/\
U ||----w |
|| || oOo
Multi-byte strings may have line length calculation issues
when combined with single byte characters, but shouldn't break…
--------------------------------------------------
/ UTF8 will \
| truncate |
| to 10 |
| chars. |
| Other byte |
| lengths |
| won't. |
| 现在怎么棕色的牛。这不是多字节字符串的精彩演示吗? |
| 现在怎么棕色的牛。这不是多字节字符串的精彩演示吗? |
\ 现在怎么棕色的牛。这不是多字节字符串的精彩演示吗? /
--------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||