Doug,
Jeff has already written the code, but it depends, if you are on PHP 5.4, then you have to install opcache extension separately, else from PHP 5.5 onwards, this comes as a part of PHP already, all you have to do is copy the code Jeff wrote in your php.ini file and you're good to go.
You can skip the last moodle config section for these are the settings your may have already have in place.
additionally, this Jeff's code wont automatically enable opcache extension and get rid of exclamation mark, there is additional line that needs to be mentioned, so if you are on Linux platform, then add this line into your php.ini
zend_extension=/full/path/to/opcache.so
if you're on Windows platform, then add this line instead
zend_extension=php_opcache.dll
You will be adding these lines BEFORE what Jeff mentioned.
and last but not least, as you mentioned Moodle 3.1, then change the figure to 8000 in this line
opcache.max_accelerated_files = 4000 (change to 8000, for moodle 3+ has more files to be cached)