note 20207 added to function.system
| From: | james at jsrobertson dot net | Date: | Tue, 26 Mar 2002 16:48:27 +0000 |
| Subject: | note 20207 added to function.system | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28234@lists.php.net to get a copy of this message | ||
I've found a very useful technique for the system function. Say if you want to create a page of
quotes and you have /usr/games/fortune available. Instead of spending time creating a database and
populating it with thousands of quotes, you can just use:
<?php
system('/usr/games/fortune');
?>
likewise if you want to list the files in your directory, say for example, Mp3's?
<?php
system('ls /home/mp3 -l');
?>
basically
<?php
system('any_command');
?>
--
http://www.php.net/manual/en/function.system.php
http://master.php.net/manage/user-notes.php?action=edit+20207
http://master.php.net/manage/user-notes.php?action=delete+20207
http://master.php.net/manage/user-notes.php?action=reject+20207