This library takes good care of URI or URL of a page.
Github: https://github.com/horlarme/uriman, (*1)
uriman is a PHP library which is meant to manipulate the Uniform Resource Identifier (URI) of a particular web site or page. uriman is developed to work with all PHP versions., (*2)
File folder structure of uriman., (*3)
To start the library, include the main class using the code below, (*4)
include_once "uriman/src/uriman.php";
Or you could just add the library directly to your app using composer, (*5)
composer require horlarme/uriman
Example:, (*6)
use uriman\uriman; //uriman namespace $uri = new uriman; //Using the class file
Use the below code to start or instantiate uriman to get what it needs to function, (*7)
$uri->start(); //Starting uriman
To get the full address of the current page, (*8)
echo "My Address: " . $uri->address . "<br />\n"; //Get the complete URL address of the current page
To get the value of a url/uri query, (*9)
echo "The value for name: " . $uri->show("name") . "<br />\n"; //Getting the value of a URI query
To edit a value of a uri query, (*10)
$uri->edit("name", "Lawal Oladipupo");, (*11)
The below code output the uri queries as an array, (*12)
echo "<pre>"; print_r($uri->uri_array); echo "</pre><br />";
The below code output the uri values as JSON format, (*13)
echo "JSON Format:" . $uri->uri_json;
Note: Please this is the first production file, so there might be some issues and also, the script doesn't produce/provide any error notice, if it doesn't work, you'll have to debug manually., (*14)
Contact the developer: lawboi4love@gmail.com, (*15)