CKTIS / PHP
strncasecmp()
Confronta al massimo length byte senza distinguere le maiuscole ASCII.
Versione: PHP 8.4; repository runtime, production runtime not attested
Sintassi
strncasecmp(string $string1, string $string2, int $length): intConfronta al massimo length byte senza distinguere le maiuscole ASCII. Prefissi uguali possono dare zero per stringhe diverse. Lunghezza zero dà zero e una negativa genera ValueError. In caso di differenza conta il segno.
Firma
strncasecmp(string $string1, string $string2, int $length): int
Output dell’esempio
[0,true,0]
Esempi
<?php
echo json_encode([strncasecmp("Header-A","header-B",6),strncasecmp("Header-A","header-B",8)<0,strncasecmp("x","y",0)]);
Risultato
[0,true,0]