1) Shouldn't "-opt" be "--opt"?
2) You could optimize the loops slightly by removing processing that doesn't need to be done on every loop iteration, but I doubt if it really matters here, since there are only 17 tables.
code:
$COMMAND_DO = $PATHTOMYSQLDUMP . "mysqldump -opt -h" . $config['dbserver']
. " -u" . $config['dbuser'] . " -p" . $config['dbpass']
. " " . $config['dbname'] . " ";
for ($i=0; $i<count($tb_names); $i++) {
$table_name = $tb_names[$i];
echo "$table_name<br />";
$COMMAND_DO .= "$table_name > $DIRNAME.$table_name.sql";