Example 1 — Find a Word Ignoring Case
Upper and lower case are treated the same.
<?php
$pos = stripos("Hello World", "WORLD");
echo $pos, PHP_EOL; How It Works
- Pass a haystack. It is
"Hello World". - Search in capitals.
WORLDstill matches. - Count from 0. The word starts at index 6.
- Print the position. The output is
6.

