Skip to content

Commit

Permalink
IRI documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Simbiat authored Jun 16, 2024
1 parent 6c42117 commit 4c932bf
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions doc/IRI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
- [isValidIri](#isvalidiri)
- [iriToUri](#iritouri)
- [restoreUri](#restoreuri)

# IRI

Functions useful for work with International Resource Identifiers (IRIs)

```php
\Simbiat\HTTP20\IRI::nameOfFunction();
```

## isValidIri

```php
isValidIri(string $iri)
```

Checks if string is a valid IRI (by trying to convert it to a valid URL first). Returns `bool` value.

## iriToUri

```php
iriToUri(string $iri)
```

Converts IRI to URI. Returns `null` in case of failures or a string, if no obvious failures were observed.

## restoreUri

```php
restoreUri(array $parsedUri)
```

Restore array from `parse_url()` function to original URL.

0 comments on commit 4c932bf

Please sign in to comment.