check php version
/* in terminal type it*/
php -v<?php
$json = file_get_contents('https://www.php.net/releases/?json');
$releases = [];
if ($json) $releases = json_decode($json, true);
/**
* Versions
Array
(
[0] => 7
[1] => 5
[2] => 4
[3] => 3
)
*/
$versions = array_keys($releases);
/** solution to: latest php version */
if (array_key_exists(max($versions), $releases)) {
echo $releases[max($versions)]['version']; // as of Aug 2020.. 7.4.9
}
<?phpphpinfo(); ?>echo PHP_VERSION;<?php
echo 'PHP version: ' . phpversion();
?>
Also in PHP:
- check if a text include a word php
- debug php with print
- create user laravel seeder
- check if a word is present inside a string in php
- array push in php
- date to string php
- check if char exists in string php
- e_all error php
- PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Eav\Model\Attribute\Data\Text::validateLength() must be of the type string, null given
- add days with dates php
- codeigniter delete record by id
- check if is key in array php
- echo php dropdown from db and save it in a db
- after for each loop in php
- cache laravel example
- cache out en laravel
- branch from other branch
- Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://C:/Users/Public/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223
- create new laravel project terminal
- don't show php errors
- date math sql php
- composer laravel 7
- Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". when php is 7.4
- create random username and password php