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.";
}
}