CKTIS / PHP
strripos()
Trouve la dernière position correspondante sans distinguer la casse ASCII.
Version : PHP 8.4; repository runtime, production runtime not attested
Syntaxe
strripos(string $haystack, string $needle, int $offset = 0): int|falseTrouve la dernière position correspondante sans distinguer la casse ASCII. Un offset positif exclut les départs antérieurs, un négatif borne le dernier départ depuis la fin. L’indice est en octets et zéro doit être distingué de false.
Signature
strripos(string $haystack, string $needle, int $offset = 0): int|false
Sortie de l’exemple
[6,6,3,false]
Exemples
<?php
$s="AbxABxab"; echo json_encode([strripos($s,"aB"),strripos($s,"aB",4),strripos($s,"aB",-4),strripos($s,"zz")]);
Résultat
[6,6,3,false]