PHPackages                             akondas/chess.php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. akondas/chess.php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

akondas/chess.php
=================

chess.php is a PHP chess library that is used for chess move generation/validation, piece placement/movement, and check/checkmate/stalemate detection

v1.0.5(7y ago)5504↑900%2MITPHPPHP ^7.2

Since May 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/akondas/chess.php)[ Packagist](https://packagist.org/packages/akondas/chess.php)[ RSS](/packages/akondas-chessphp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (9)Used By (0)

Chess.php
=========

[](#chessphp)

chess.php is a PHP chess library that is used for chess move generation/validation, piece placement/movement, and check/checkmate/stalemate detection - basically everything but the AI.

NOTE: this is a port of [chess.js](https://github.com/jhlywa/chess.js) for php, froked from [ryanhs/chess.php](https://github.com/ryanhs/chess.php)

[![Minimum PHP Version](https://camo.githubusercontent.com/4c62148864d567c4ee794ffab09c1dd4a3f45e41064bbb016440beddaae71a4d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e322d3838393242462e737667)](https://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/a7ff52e34ab0e392b1a93495f210d00503d0ba25411f499c2431c0a677a91e8f/68747470733a2f2f706f7365722e707567782e6f72672f616b6f6e6461732f63686573732e7068702f762f737461626c65)](https://packagist.org/akondas/ryanhs/chess.php)[![Build Status](https://camo.githubusercontent.com/a1a9175e7e09965b4d648fce73f06cad4b5c16660a7afc9125e7f939f1f930eb/68747470733a2f2f7472617669732d63692e6f72672f616b6f6e6461732f63686573732e7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/akondas/chess.php)[![MIT License](https://camo.githubusercontent.com/50b7a5d7d163251b40aa13a65fa6e31a05573b4842a575425f0e5ee5a5ecd04b/68747470733a2f2f706f7365722e707567782e6f72672f7279616e68732f63686573732e7068702f6c6963656e7365)](https://packagist.org/packages/ryanhs/chess.php)

Installation
------------

[](#installation)

use composer with `composer require akondas/chess.php`
or put in your composer.json

```
"require": {
	"ryanhs/chess.php": "^1.0"
}

```

Example Code
------------

[](#example-code)

The code below plays a complete game of chess ... randomly.

```
