mpd-php is a php library for controlling a mpd server.
Import mpd.php in your web project:
include 'mpd.php';
Configure the connection settings and connect to a mpd server:
$mpd = new mpd('127.0.0.1', 6600);
if ($mpd->connect()) {
alert("Connected!");
}
Control server playback:
$mpd->play($songnr);
$mpd->stop();
$mpd->resume();
$mpd->next();
$mpd->previous();
$mpd->clear();
Get database informations:
$mpd->getArtistnames();
$mpd->getAlbumnamesFromArtist($artist);
$mpd->isPlaying();
Control playlists:
$mpd->listPlaylists();
$mpd->listPlaylist($playlist);
$mpd->getCurrentSong();
$mpd->loadPlaylist($playlist)();
Disconnect from server:
$mpd->disconnect();