Advertisement
Guest User

Untitled

a guest
Mar 5th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. #!/usr/local/bin/php
  2.  
  3. <?php
  4. function readline($prompt = null){
  5.     if($prompt) {
  6.         //echo $prompt;
  7.     }
  8.     $fp = fopen("php://stdin","r");
  9.     $line = rtrim(fgets($fp, 1024));
  10.     return $line;
  11. }
  12. $cur = 0;
  13. foreach ($argv as $ffffff) {
  14.     $cur += 1;
  15.     file_put_contents("/home/basel/Desktop/php/h.txt","arg" . $cur . ": " . $ffffff."\n", FILE_APPEND);
  16. }
  17. file_put_contents("/home/basel/Desktop/php/h.txt","\n\n\n", FILE_APPEND);
  18.  
  19. while (1) {
  20.     $gg = readline();
  21.     if ($gg == "") {
  22.     } else {
  23.         file_put_contents("/home/basel/Desktop/php/ht.txt",":" . $gg."\n",FILE_APPEND);
  24.     }
  25. }
  26. file_put_contents("/home/basel/Desktop/php/h.txt","----end----\n\n", FILE_APPEND);
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement