function get_instagram_user_i d_by_screen_name client_id screen_name u

1
2
3
4
function get_instagram_user_id_by_screen_name($client_id, $screen_name) {
$user_id = (int)json_decode(file_get_contents('https://api.instagram.com/v1/users/search?q=' . $screen_name . '&client_id=' . $client_id))->data[0]->id;
return $user_id;
}