Check string length in PHP
Try the common syntax instead:
if (strlen($message)<140) {
echo "less than 140";
}
else
if (strlen($message)>140) {
echo "more than 140";
}
else {
echo "exactly 140";
}
[0]=> string(141)
means $message is an array so you should do strlen($message[0]) < 141
...
[0]=> string(141)
means that $message is an array, not string, and $message[0] is a string with 141 characters in length.