Created
January 9, 2012 11:30
-
-
Save mach3/1582574 to your computer and use it in GitHub Desktop.
ページがLikedかどうかを得るだけの簡単な関数
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* likedを得るだけの簡単な関数 | |
*/ | |
function getLiked(){ | |
$signed_request = isset( $_POST["signed_request"] ) ? $_POST["signed_request"] : null; | |
$json = json_decode( base64_decode( array_pop( explode( ".", $signed_request ) ) ) ); | |
if( isset( $json->page ) && isset( $json->page->liked ) ){ | |
return $json->page->liked; | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment