php langhelper (needs funcy/php), tutorial

This commit is contained in:
Chad Arimura
2017-05-26 12:36:38 -07:00
parent 98e05eec63
commit b49337d4e0
10 changed files with 188 additions and 57 deletions

View File

@@ -0,0 +1,10 @@
<?php
require 'vendor/autoload.php';
stream_set_blocking(STDIN, 0);
$payload = json_decode(file_get_contents("php://stdin"), true);
if (isset($payload['name'])) {
echo "Hello ", $payload['name'],"!\n\n";
} else {
echo "Hello World!\n\n";
}