gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
https://y.music.163.com/m/song?id=354750&uct2=rF65H3x9GoAv%2BMei7iMB6w%3D%3D&fxwxqdab=c&f…
- User
- Assistant
以下是通过正则表达式获取链接中ID参数值的PHP代码:
$url = "https://y.music.163.com/m/song?id=354750&uct2=rF65H3x9GoAv%2BMei7iMB6w%3D%3D&fx_wxqd_ab=c&fx-wechatnew=t4&dlt=0846&app_version=8.20.11&evokeChainInitType=direct&evokeChain=initChain.type_dircet&thirdfrom=wx"; $pattern = '/(?<=id=)\d+/'; // 正则表达式匹配模式 preg_match($pattern, $url, $matches); // 执行正则匹配 $id = $matches[0]; // 获取匹配结果 echo $id; // 输出ID参数的值这段代码会输出链接中ID参数的值,即354750。