Skip to content

Instantly share code, notes, and snippets.

@mach3
Created January 9, 2012 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mach3/1582574 to your computer and use it in GitHub Desktop.
Save mach3/1582574 to your computer and use it in GitHub Desktop.
ページがLikedかどうかを得るだけの簡単な関数
<?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