PHP code example of kristos80 / yuri

1. Go to this page and download the library: Download kristos80/yuri library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kristos80 / yuri example snippets



use Kristos80\Yuri\Yuri;

dummy.com/path/index.html?q[]=1&q[]=2');

//@see Yuri::asJsonString(bool $prettyPrint = FALSE)
echo($yuri->asJsonString(TRUE)); 

//@see Yuri::getQueryVar(string $varNotation, $defaultValue = NULL)
//Notation syntax is, also, supported
echo $yuri->getQueryVar('q.0','defaultValueIfNotExists'); 

//@see Yuri::getPathByIndex(int $pathIndex = 0)
echo $yuri->getPathByIndex();

getOriginalUri(): string {}
getNormalizedUri(bool $useTrailingSlash = FALSE): string {}
isFile(): bool {}
isWww(): bool {}
getNormalizedUriWithSlash(): string {}
getScheme(): ?string {}
getHost(bool $removeSubDomains = FALSE): ?string {}
getTld(): string {}
getPaths(bool $useNullOnEmptyPaths = FALSE): ?array {}
getPath(bool $useSlashOnEmptyPath = FALSE): string {}
getQuery(): array {}
getOriginalQueryString(bool $useQuestionMark = FALSE): string {}
getQueryString(bool $useQuestionMark = FALSE): string {}
getPort(): ?int {}
getUid(): string {}
isHttps(): bool {}
getPathByIndex(int $pathIndex = 0): ?string {}
getQueryVar(string $varNotation, $defaultValue = NULL) {}
asArray(): array {}
asClass(): \stdClass {}
asJsonString(bool $prettyPrint = FALSE): string {}