Revision 19792,
585 bytes
checked in by Seasoft, 13 years ago
(diff) |
#744(PHP4 互換用途ソースを将来的に切り捨てやすい仕組みづくり)
|
Line | |
---|
1 | --TEST--
|
---|
2 | Function -- stripos
|
---|
3 | --SKIPIF--
|
---|
4 | <?php if (function_exists('stripos')) { echo 'skip'; } ?>
|
---|
5 | --FILE--
|
---|
6 | <?php
|
---|
7 | require_once 'PHP/Compat.php';
|
---|
8 | PHP_Compat::loadFunction('stripos');
|
---|
9 |
|
---|
10 | $haystack = 'Cat Dinner Dog Lion Mouse Sheep Wolf Cat Dog';
|
---|
11 | $needle = 'DOG';
|
---|
12 |
|
---|
13 | // Simple
|
---|
14 | var_dump(stripos($haystack, $needle));
|
---|
15 |
|
---|
16 | // With offset
|
---|
17 | var_dump(stripos($haystack, $needle, 4));
|
---|
18 | var_dump(stripos($haystack, $needle, 10));
|
---|
19 | var_dump(stripos($haystack, $needle, 15));
|
---|
20 | var_dump(stripos($haystack, 'idontexist', 15));
|
---|
21 | ?>
|
---|
22 | --EXPECT--
|
---|
23 | int(11)
|
---|
24 | int(11)
|
---|
25 | int(11)
|
---|
26 | int(41)
|
---|
27 | bool(false) |
---|
Note: See
TracBrowser
for help on using the repository browser.