Skip to content

Instantly share code, notes, and snippets.

@jarenal
Created March 15, 2023 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarenal/ff06785f3043f9eed36cd27916c9d364 to your computer and use it in GitHub Desktop.
Save jarenal/ff06785f3043f9eed36cd27916c9d364 to your computer and use it in GitHub Desktop.
Gets require php from a composer.json file
<?php
$composerRaw = file_get_contents("./composer.json");
$composerJson = json_decode($composerRaw, true);
echo $composerJson["name"] . " PHP " . $composerJson["require"]["php"] . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment