Created
July 7, 2018 11:45
-
-
Save meysam-mahmoodi/100e60910aa0033aed26db919fcec55b to your computer and use it in GitHub Desktop.
Create a sample php function in fn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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