I have a string that is 141 characters in length. Using the following code I have an if
statement to return a message if the string is greater or less than 140.
The xpath() function does not return a string. It returns an array with XML elements (of type SimpleXMLElement), which may be casted to a string.
if (count($message)) {
if (strlen((string)$message[0]) < 141) {
echo "There Are No Contests.";
}
else if(strlen((string)$message[0]) > 142) {
echo "There is One Active Contest.";
}
}