Loading...

parse_url解析 URL

Temperature: 0 °C

Mark ChangMark Chang
author_tools

parse_url() 用來解析 URL 的函數,適用於(PHP 4, PHP 5, PHP 7)。
對嚴重不合格的 URL,parse_url() 可能會返回 FALSE。
如果省略了 component 參數,將返回一個關聯數組 array,在目前至少會有一個元素在該數組中。數組中可能的鍵有以下幾種:

scheme - 如 http
host
port
user
pass
path
query - 在問號 ? 之後
fragment - 在散列符號 # 之後

範例
https://www.myweb.tw/demo.php?page=2
若輸出$parse_url["query"]
得到的是/demo.php

以上紀錄


 

https://innstory.com/story-parseurl解析_URL-2268
PHP

Prev
 讓文字左右對齊

Next
修改phpini更改允許上傳檔案的大小 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

分享 刺激銷量? 市場再傳蘋果計畫推出紅色款 iPhone X - 手機新聞 | ePrice 比價王

分享 刺激銷量? 市場再傳蘋...

紅蘋果都要出來了...意思是說以後還有可能有青蘋果嗎? 所以光用顏色就可以刺激到銷量~果然....人...

使用javascript 正規化判斷網址url是否正確

使用javascript 正...

使用javascript判斷網址url是否正確 正規化方式如下: var str = URL; //...

分享 Garmin將台灣列國家「被道歉」 他嘆:將台灣除名何其諷刺 - 國際 - 自由時報電子報

分享 Garmin將台灣列國...

為什麼會被欺負,不夠強大?不夠團結?又或者不被別人認同,甚至不被以為的自己人認同?

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format