Checking the PHP Version on Hosting
The PHP versions installed on your computer and on the hosting may differ. This can lead to a situation where a script that works locally, will not work on the hosting due to the difference in versions.
To find out which PHP version is installed, you need to create a PHP file with the following content:
<?php
phpinfo();
?>
Then you need to access this file through the browser's address bar. At the very top of the page, you will see the current PHP version.
Find out the PHP version on your computer.
Find out the PHP version on your hosting.