-
-
Save pietromalerba/205433f1f15aac130f1d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
// get like status | |
$liked = (new FacebookRequest( $session, 'GET', '/me/likes/' . $page_id ))->execute()->getGraphObject()->asArray(); | |
// if $liked return array with at least one result, user has liked the page | |
if ( isset( $liked ) && count( $liked ) > 0 ) { | |
echo '<h2>Liked</h2>'; | |
} else { | |
echo '<h2>Not Liked</h2>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment