filename, $arg) === false) { $match = false; break; } $match = true; } if ($match) { $results[] = $config["url"] . "/" . $upload->filename; } } // Return results if (empty($results)) { echo "No results found\n"; } else { foreach($results as $result) { echo $result . "\n"; } } } catch (Exception $e) { echo $e->getMessage() . "\n";die(); } function read_stdin() { $fr=fopen("php://stdin","r"); // open our file pointer to read from stdin $input = fgets($fr,128); // read a maximum of 128 characters $input = rtrim($input); // trim any trailing spaces. fclose ($fr); // close the file handle return $input; // return the text entered }