I have created a document in an MongoDB database and I wanted to show the results of the database on a web page with PHP on of the types of the properties of the document is an array that contains string. When I do show the connections this is what shows up
Name: Harry Anderson
Jersey 9
Position Array
The correct position should be "LF", "RF"
The PHP code I am using to get that result is
foreach ($cursor as $obj) {
echo "Name: ". $obj["name"]. "<br/>";
echo "Jersey ". $obj["jersey"]. "<br/>";
echo "Position ". $obj["position"]. "<br/>";
echo "<br/>";
}
I know that I am putting the position object incorrectly and it should be some indication of it being an array