K
Kirby
Guest
PHP:
Read more
Continue reading...
Code:
if ($response->getStatusCode() == 200)
{
try
{
$json = json_decode($jsonText, true);
if (!empty($json['title']))
{
$title = $json['title'];
}
else if (!empty($json['author_name']))
{
$title = $json['author_name'];
}
$validOembed = true;
}
catch (\Exception $e)
{
$error = \XF::phraseDeferred('returned_data_is_not_json');
}
json_decode
doesn't throw an...Read more
Continue reading...