I checked if the variable is an array.
I can return desired elements out of the array by going $array[n]
;
因此,这是一件好事。
但是,在以下法典中,如果我能打上<代码>($array),那么我就拿不到退还的内容。
//converting string $messages to array:
$messagesArr = explode("<hr/>", $messages);
if (is_array($messagesArr )){print("<p style= color:red >Array OK<p>");}
else {print("<p style= color:red >Array not OK<p>");}
$secondElement = $messagesArr[1];
print("<p style= color:red >second element is: $tweedeElem<p>");
// This one actually outputs the desired second element of the array
$amountMess = count($messagesArr);
print("<p style= color:red >the amount of messages is: $amountMess<p>");