Link to home
Start Free TrialLog in
Avatar of Mehran Goudarzi
Mehran Goudarzi

asked on

$_GET call between URL

<?php
if( $_GET["shortcode"]) {
$api = file_get_contents("https://api.instagram.com/oembed/?url=http://instagram.com/p/"$_GET["shortcode"]"/");      
$apiObj = json_decode($api,true);      
$media_id = $apiObj['media_id'];
echo $_GET["shortcode"];
}

Open in new window


it not work . how can i call $_GET between URL
http://instagram.com/p/"$_GET["shortcode"]"/");

Open in new window

Avatar of Leonidas Dosas
Leonidas Dosas
Flag of Greece image

Try with isset function:

if(isset( $_GET["shortcode"])){
//code here...
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Peos John
Peos John
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you're new to PHP and want some good learning resources, this article can help.
https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html