Skip to content

Instantly share code, notes, and snippets.

@fu-sen
Last active June 2, 2021 04:14
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 fu-sen/a386ad88766fec440b4fe078f26f0c81 to your computer and use it in GitHub Desktop.
Save fu-sen/a386ad88766fec440b4fe078f26f0c81 to your computer and use it in GitHub Desktop.
phpinfo() with IBM Cloud Functions - This output will be the Plain Text version.
<?php
function main(array $args) : array
{
ob_start();
phpinfo();
$phpinfo = ob_get_contents();
ob_end_clean();
return [
"headers" => ['Content-Type' => 'text/plain'],
"body" => $phpinfo
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment