Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 465 Bytes

load.md

File metadata and controls

30 lines (22 loc) · 465 Bytes

PGN load

simply, just use: $chess->loadPgn($pgnString);

example

<?php
use \Ryanhs\Chess\Chess;

$return = $chess->loadPgn('1.e4 e5 2.Nf3'); // return TRUE

$return = $chess->loadPgn('1.e4 e5 invalid PGN 2.Nf3'); // return FALSE


$return = $chess->loadPgn(<<<EOD
[Event "Earl tourn"]
[Site "?"]
1.e4 e5 2.Nf3
EOD
; // return TRUE

$return = $chess->loadPgn(<<<EOD
[Event "Earl tourn"]
make it invalid
[Site "?"]
1.e4 e5 2.Nf3
EOD
; // return FALSE