Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Hi in my url i have variables stored in ../index.php?cat=1#5#8 in so on how to separate them using explode function so out put could be
arr[0]=1 arr[1]=5 arr[2]=8
试试explode喜欢
explode
$arr = explode("#",$_GET['cat']);
但正如@Bora 所说#,剩余的字符串可能不会被发送,所以最好使用 '_' 代替 '#' (1_5_8_....) 并且可以像
#
$arr = explode("_",$_GET['cat']);
尝试这个:
$array=$_GET['cat']; $result = explode("#",$array);