Download the PHP package zerig/url-parser without Composer
On this page you can find all versions of the php package zerig/url-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zerig/url-parser
More information about zerig/url-parser
Files in zerig/url-parser
Package url-parser
Short Description class of object which parse url and can work with it.
License MIT
Informations about the package url-parser
URL-PARSER \ URL
class which parse url and enable this URL for more operations.
makeItString($url_path)
$url_path [string || array of string]
Correct URL in right FORM. You can use STRING or ARRAYofSTRINGS to create url.
This method also erase double slashes.
pop($times)
- $times [int] How many time
- @return [string / array of string] What was popped
Remove last part of url PATH. NOT just print, but REMOVE!!!\n
shift($times)
$times [int] How many time
Remove first part of url PATH. NOT just print, but REMOVE!!!
swap($from, $to)
$from [string] which part of URL PATH should be changed
$to [string] changed to this
Change one part of URL PATH for a new one.
get....($exp)
$exp [string] In which form do we want export
- getScheme() - how is variable saved [string | array of string | key array]
- getScheme("string") - how could be written in URL
- getScheme("array") - in array [array of string | key array]
- getScheme() - get scheme part: "http"
- getHost() - get Host part: "web.cz"
- getRoot() - get Root part: ["aaa"]
- getPath() - get Path part: ["bbb", "a.html"]
- getQuery() - get Query part: ["member" => "me", "age" => "15"]
- getFragment() - get hastag part: "hashtag"
getString()
get the whole URL in string format.
getDepth()
return number of all folder from ROOT
linkRoot()
return path, which return this url to root
addPath($add_part)
$add_part [string | array of strings] add items to ROOT part.
beforePath($add_part)
$add_part [string | array of strings] add items to ROOT part.
addQuery($add_part)
$add_part [key array] add items to ROOT part.
hasExtension()
return 1 if the URL is ending with file: ".../a.html"
return 0 if the URL is ending onn folder: ".../a"
getExtension()
Get extension of URL
removeExtension()
If URL has extension => ".html" it will remove it from path
exist()
check if URL exist as File/Folder
isFolder()
check if URL exist as Folder
isFile()
check if URL exist as File
remove...()
$add_part [key array] add items to ROOT part.
- removeScheme() - remove scheme part: "http"
- removeHost() - remove Host part: "web.cz"
- removeRoot() - remove Root part: ["aaa"]
- removePath() - remove Path part: ["bbb", "a.html"]
- removeQuery() - remove Query part: ["member" => "me", "age" => "15"]
- removeFragment() - remove hastag part: "hashtag"