latest php version linux code example
Example 1: php version command linux
PHP 5.4.16 (cli) (built: Mar 7 2018 13:34:47)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Example 2: latest php version
<?php
$json = file_get_contents('https://www.php.net/releases/?json');
$releases = [];
if ($json) $releases = json_decode($json, true);
$versions = array_keys($releases);
if (array_key_exists(max($versions), $releases)) {
echo $releases[max($versions)]['version'];
}