update page now

Uri\Rfc3986\Uri::equals

(PHP 8 >= 8.5.0)

Uri\Rfc3986\Uri::equalsCheck if two URIs are equivalent

Açıklama

public Uri\Rfc3986\Uri::equals(Uri\Rfc3986\Uri $uri, Uri\UriComparisonMode $comparisonMode = Uri\UriComparisonMode::ExcludeFragment): bool

Checks if two URIs are equivalent.

Bağımsız Değişkenler

uri
URI to compare the current URI against.
comparisonMode
Whether the fragment component is taken into account of the comparison (Uri\UriComparisonMode::IncludeFragment) or not (Uri\UriComparisonMode::ExcludeFragment). By default, the fragment is excluded.

Dönen Değerler

Returns true if the two URIs are equivalent, or false otherwise.

Örnekler

Örnek 1 Uri\Rfc3986\Uri::equals() basic example

<?php
$uri1
= new \Uri\Rfc3986\Uri("https://example.com");
$uri2 = new \Uri\Rfc3986\Uri("HTTPS://example.com");

var_dump($uri1->equals($uri2));
?>

Yukarıdaki örneğin çıktısı:

bool(true)

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top