我需要知道如何从instagram URL进行preg_match ID
https://www.instagram.com/p/BrODgnXHlE6/?utm_source=ig_share_sheet&igshid=znsinsart176
我尝试过
preg_match('/https://www.instagram.com/p/(。)/(。)/ U',$ video_url,$ matches);
$video_id = $matches[1];
但是它不起作用 谢谢
答案 0 :(得分:0)
<?php
$url = "https://www.instagram.com/p/BrODgnXHlE6/?utm_source=ig_share_sheet&igshid=znsinsart176";
preg_match('/https:\/\/www.instagram.com\/p\/(.+)\/(.+)/U', $url, $matches);
$id = $matches[1];