是否可以使用PHP运行多个linux命令。我正在使用Mongodb数据库,如果我想导入多个集合,我为每个集合分别运行以下命令。如何使用PHP运行多个linux命令
mongoimport --db test --collection colour --file colour.json
mongoimport --db test --collection shape --file shape.json
mongoimport --db test --collection size --file size.json
现在我至少有10个集合,我必须在linux命令行中分别运行它们中的每一个。应该有更好的方法来做到这一点。我在想的是写一个PHP脚本,这将为我做这个。
任何想法,建议将非常有帮助。提前致谢。