Added lot of junk laying around on harvie.cz
[mirrors/Programs.git] / php / skripty / stdin_socket.php
diff --git a/php/skripty/stdin_socket.php b/php/skripty/stdin_socket.php
new file mode 100644 (file)
index 0000000..547bd07
--- /dev/null
@@ -0,0 +1,22 @@
+<?php\r
+\r
+$sfp = fsockopen ("127.0.0.1", 24, &$errno, &$errstr, 5);\r
+$ifp = fopen ("php://stdin", "r");\r
+\r
+/*\r
+while(1) {\r
+echo(ord(fgetc($ifp)));\r
+}\r
+*/\r
+\r
+while($sfp) {\r
+  if (!feof($sfp)) { \r
+    echo (fgetc($sfp));\r
+  }\r
+\r
+  if (!feof($ifp)) { \r
+    fwrite ($sfp, fgetc($ifp));\r
+  }\r
+}\r
+\r
+?>\r
This page took 0.088542 seconds and 4 git commands to generate.