I am currently using facebook php and am trying to get a specific page name based off of a user entered name.
For example lets say I have an array of (Apple,Orange,Pear). I have a variable $var = "Pea". How would i set a new variable lets say result = Pear. At the moment I am hardcoding in the exact facebook page name like so :
if($key['name']=="Exact Page Name HERE"){
$post = $fb->post('/' . $key['id'] . '/feed',$params, $key['access_token']);
$post = $post->getGraphNode()->asArray();
echo ("Post successful");
}
My goal is to be able to get the array of user managed pages from facebook and then compare the name of each page to the user entered variable and set the page name = to the name that matches the variable the closest.