|
| |
1 |
|
<?php |
|
| |
2 |
|
|
|
| |
3 |
|
|
|
| |
4 |
|
|
|
| |
5 |
|
|
|
| |
6 |
|
|
|
| |
7 |
|
|
|
| |
8 |
|
|
|
| |
9 |
|
|
|
| |
10 |
|
|
|
| |
11 |
|
|
|
| |
12 |
|
|
|
| |
13 |
|
|
|
| |
14 |
|
|
|
| |
15 |
|
|
|
| |
16 |
|
|
|
| |
17 |
|
|
|
| |
18 |
|
|
|
| |
19 |
|
|
|
| |
20 |
|
|
|
| |
21 |
|
|
|
| |
22 |
|
|
|
| |
23 |
|
|
|
| |
24 |
|
|
|
| |
25 |
|
|
|
| |
26 |
|
|
|
| |
27 |
|
|
|
| |
28 |
|
|
|
| |
29 |
|
|
|
| |
30 |
|
|
|
| |
31 |
|
|
|
| |
32 |
|
|
|
| |
33 |
|
|
|
| |
34 |
|
if (!function_exists('stripos')) |
|
| |
35 |
|
{ |
|
| |
36 |
|
function stripos ($haystack, $needle, $offset = null) |
|
| |
37 |
|
{ |
|
| |
38 |
|
if (!is_scalar($haystack)) { |
|
| |
39 |
|
trigger_error('stripos() expects parameter 1 to be string, ' . gettype($haystack) . ' given', E_USER_WARNING); |
|
| |
40 |
|
return false; |
|
| |
41 |
|
} |
|
| |
42 |
|
|
|
| |
43 |
|
if (!is_scalar($needle)) { |
|
| |
44 |
|
trigger_error('stripos() needle is not a string or an integer.', E_USER_WARNING); |
|
| |
45 |
|
return false; |
|
| |
46 |
|
} |
|
| |
47 |
|
|
|
| |
48 |
|
if (!is_null($offset) && !is_numeric($offset)) { |
|
| |
49 |
|
trigger_error('stripos() expects parameter 3 to be long, ' . gettype($offset) . ' given', E_USER_WARNING); |
|
| |
50 |
|
return false; |
|
| |
51 |
|
} |
|
| |
52 |
|
|
|
| |
53 |
|
|
|
| |
54 |
|
$fix = 0; |
|
| |
55 |
|
if (!is_null($offset)) |
|
| |
56 |
|
{ |
|
| |
57 |
|
if ($offset > 0) |
|
| |
58 |
|
{ |
|
| |
59 |
|
$haystack = substr($haystack, $offset, strlen($haystack) - $offset); |
|
| |
60 |
|
$fix = $offset; |
|
| |
61 |
|
} |
|
| |
62 |
|
} |
|
| |
63 |
|
|
|
| |
64 |
|
$segments = explode (strtolower($needle), strtolower($haystack), 2); |
|
| |
65 |
|
$position = strlen($segments[0]) + $fix; |
|
| |
66 |
|
|
|
| |
67 |
|
return $position; |
|
| |
68 |
|
} |
|
| |
69 |
|
} |
|
| |
70 |
|
|
|
| |
71 |
|
?> |