samedi 31 janvier 2015

IF statement with Graph API

I'm trying to show from data from Graph API, however I'm new with PHP and I'm struggling to get it to work. I've been working with the old API and have only just managed to convert some old code to new code, so it's a little messy. Can anyone see what's stopping this from functioning?



echo print_r( $graphObject, 1 );
echo "<br><h2><b><u>First Company</u></b></h2>";
echo 'Name: '.$graphObject->getProperty('name').;
echo 'Phone: '

if .$graphObject->getProperty['phone']. {
echo .$graphObject->getProperty('phone');
} else {
echo "No phone number available.";
}


I've managed to get the 'Name', but I'm trying to create an IF statement as the page doesn't have a phone number available.


Aucun commentaire:

Enregistrer un commentaire