Skip to content

Instantly share code, notes, and snippets.

@meysam-mahmoodi
Created July 7, 2018 11:45
Show Gist options
  • Save meysam-mahmoodi/100e60910aa0033aed26db919fcec55b to your computer and use it in GitHub Desktop.
Save meysam-mahmoodi/100e60910aa0033aed26db919fcec55b to your computer and use it in GitHub Desktop.
Create a sample php function in fn
<?php
header('Content-Type: application/json');
$data = json_decode(file_get_contents('php://input'), true);
if( !is_null($data) ) {
echo json_encode($data);
}
$input_data = file_get_contents("php://stdin");
//var_dump(file_get_contents("php://stdin"));
if( $input_data != '' ){
echo $input_data;
}
if( count($_REQUEST) > 0 ){
echo json_encode($_REQUEST);
}
?>
name: php7
version: 0.0.12
runtime: php
entrypoint: php func.php
format: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment