我需要在 php 中決議一個 google sheet url 字串,洗掉它的最后一部分。例子:
$string = https://docs.google.com/spreadsheets/d/xxxx/edit#gid=xxxxxxx
然后我需要洗掉字串的 'edit#gid=xxxxxxx' 部分,如下所示:
$string_parsed = https://docs.google.com/spreadsheets/d/xxxx/
uj5u.com熱心網友回復:
試試這個: $string_parsed = explode('/','https://docs.google.com/spreadsheets/d/xxxx/edit#gid=xxxxxxx'); array_pop($string_parsed); echo implode('/', $string_parsed);
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/517824.html
標籤:php细绳网址
