Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( !empty( $problems ) ) {
- $json = json_encode( $problems );
- $url = 'http://en.lichess.org/api/problem?token=';
- $ch = curl_init( $url );
- curl_setopt( $ch, CURLOPT_POST, 1 );
- curl_setopt( $ch, CURLOPT_POSTFIELDS, $json );
- curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
- curl_setopt( $ch, CURLOPT_HEADER, 0 );
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
- $response = curl_exec( $ch );
- print_r( $response );
- return $json;
- } else {
- exit( 1 );
- }
Advertisement
Add Comment
Please, Sign In to add comment