Write a PHP script that randomly selects fact information from a two-dimensional array.
$array = array();
$array[] = array("popularity", "C++ gained instant popularity in 1983, the year it was introduced.");
$array[] = array("popularity", "C++ was the third most popular language in 2018.");
$array[] = array("popularity", "The Amazon website is written in C++.");
$array[] = array("popularity", "C++ has remained in demand since 1983 because it is a powerful tool that is adaptable.");
$array[] = array("characteristic", "C++ is an Object Oriented Programming Language (OOPL).");
$array[] = array("characteristic", "C++ has a huge function library.");
$array[] = array("characteristic", "C++ is a highly flexible language with versatility.");
$array[] = array("characteristic", "C++ can be used often for developing system software and operating systems.");
$array[] = array("characteristic", "C++ is suitable for the development of reusable software.");
The PHP script should return information, both the fact type and the fact, packed into a JSON object.